From 4faba134f5c5d20d8ff35ef4ce7d0d28bea6d55f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Thu, 7 Nov 2024 13:45:10 +0100 Subject: [PATCH] Ignore `disableMD5` option as `md5` field is removed from the spec (#1502) disableMD5 option is allowed in the spec, but ignored --- tests/UnifiedSpecTests/Context.php | 2 +- tests/UnifiedSpecTests/UnifiedSpecTest.php | 4 ---- tests/UnifiedSpecTests/Util.php | 5 +++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/UnifiedSpecTests/Context.php b/tests/UnifiedSpecTests/Context.php index 6b57a8130..40ab0c5cc 100644 --- a/tests/UnifiedSpecTests/Context.php +++ b/tests/UnifiedSpecTests/Context.php @@ -499,7 +499,7 @@ private static function prepareCollectionOrDatabaseOptions(array $options): arra private static function prepareBucketOptions(array $options): array { - Util::assertHasOnlyKeys($options, ['bucketName', 'chunkSizeBytes', 'readConcern', 'readPreference', 'writeConcern']); + Util::assertHasOnlyKeys($options, ['bucketName', 'chunkSizeBytes', 'disableMD5', 'readConcern', 'readPreference', 'writeConcern']); if (array_key_exists('bucketName', $options)) { assertIsString($options['bucketName']); diff --git a/tests/UnifiedSpecTests/UnifiedSpecTest.php b/tests/UnifiedSpecTests/UnifiedSpecTest.php index 431504226..1c4df0478 100644 --- a/tests/UnifiedSpecTests/UnifiedSpecTest.php +++ b/tests/UnifiedSpecTests/UnifiedSpecTest.php @@ -66,10 +66,6 @@ class UnifiedSpecTest extends FunctionalTestCase 'index-management/search index operations ignore read and write concern: listSearchIndexes ignores read and write concern' => 'libmongoc appends readConcern to aggregate command', // Uses an invalid object name 'run-command/runCursorCommand: does not close the cursor when receiving an empty batch' => 'Uses an invalid object name', - // GridFS deprecated fields are removed - 'gridfs/gridfs-upload-disableMD5: upload when length is 0 sans MD5' => 'Deprecated fields are removed', - 'gridfs/gridfs-upload-disableMD5: upload when length is 1 sans MD5' => 'Deprecated fields are removed', - 'gridfs/gridfs-upload: upload when contentType is provided' => 'Deprecated fields are removed', ]; /** diff --git a/tests/UnifiedSpecTests/Util.php b/tests/UnifiedSpecTests/Util.php index b812b0091..563c11ff0 100644 --- a/tests/UnifiedSpecTests/Util.php +++ b/tests/UnifiedSpecTests/Util.php @@ -137,8 +137,9 @@ final class Util 'download' => ['id'], 'rename' => ['id', 'newFilename'], 'renameByName' => ['filename', 'newFilename'], - 'uploadWithId' => ['id', 'filename', 'source', 'chunkSizeBytes', 'metadata'], - 'upload' => ['filename', 'source', 'chunkSizeBytes', 'metadata'], + // "disableMD5" is ignored but allowed for backward compatibility + 'uploadWithId' => ['id', 'filename', 'source', 'chunkSizeBytes', 'disableMD5', 'metadata'], + 'upload' => ['filename', 'source', 'chunkSizeBytes', 'disableMD5', 'metadata'], ], ];