Skip to content

Commit 4faba13

Browse files
authored
Ignore disableMD5 option as md5 field is removed from the spec (#1502)
disableMD5 option is allowed in the spec, but ignored
1 parent 0c8b2d9 commit 4faba13

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

tests/UnifiedSpecTests/Context.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ private static function prepareCollectionOrDatabaseOptions(array $options): arra
499499

500500
private static function prepareBucketOptions(array $options): array
501501
{
502-
Util::assertHasOnlyKeys($options, ['bucketName', 'chunkSizeBytes', 'readConcern', 'readPreference', 'writeConcern']);
502+
Util::assertHasOnlyKeys($options, ['bucketName', 'chunkSizeBytes', 'disableMD5', 'readConcern', 'readPreference', 'writeConcern']);
503503

504504
if (array_key_exists('bucketName', $options)) {
505505
assertIsString($options['bucketName']);

tests/UnifiedSpecTests/UnifiedSpecTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ class UnifiedSpecTest extends FunctionalTestCase
6666
'index-management/search index operations ignore read and write concern: listSearchIndexes ignores read and write concern' => 'libmongoc appends readConcern to aggregate command',
6767
// Uses an invalid object name
6868
'run-command/runCursorCommand: does not close the cursor when receiving an empty batch' => 'Uses an invalid object name',
69-
// GridFS deprecated fields are removed
70-
'gridfs/gridfs-upload-disableMD5: upload when length is 0 sans MD5' => 'Deprecated fields are removed',
71-
'gridfs/gridfs-upload-disableMD5: upload when length is 1 sans MD5' => 'Deprecated fields are removed',
72-
'gridfs/gridfs-upload: upload when contentType is provided' => 'Deprecated fields are removed',
7369
];
7470

7571
/**

tests/UnifiedSpecTests/Util.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ final class Util
137137
'download' => ['id'],
138138
'rename' => ['id', 'newFilename'],
139139
'renameByName' => ['filename', 'newFilename'],
140-
'uploadWithId' => ['id', 'filename', 'source', 'chunkSizeBytes', 'metadata'],
141-
'upload' => ['filename', 'source', 'chunkSizeBytes', 'metadata'],
140+
// "disableMD5" is ignored but allowed for backward compatibility
141+
'uploadWithId' => ['id', 'filename', 'source', 'chunkSizeBytes', 'disableMD5', 'metadata'],
142+
'upload' => ['filename', 'source', 'chunkSizeBytes', 'disableMD5', 'metadata'],
142143
],
143144
];
144145

0 commit comments

Comments
 (0)