Skip to content

Commit

Permalink
Ignore disableMD5 option as md5 field is removed from the spec (#…
Browse files Browse the repository at this point in the history
…1502)

 disableMD5 option is allowed in the spec, but ignored
  • Loading branch information
GromNaN authored Nov 7, 2024
1 parent 0c8b2d9 commit 4faba13
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/UnifiedSpecTests/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
4 changes: 0 additions & 4 deletions tests/UnifiedSpecTests/UnifiedSpecTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];

/**
Expand Down
5 changes: 3 additions & 2 deletions tests/UnifiedSpecTests/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
],
];

Expand Down

0 comments on commit 4faba13

Please sign in to comment.