Skip to content

Commit

Permalink
DRIVERS-3023 Add spec tests for GridFS Bucket rename (#1507)
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN authored Oct 31, 2024
1 parent 1c5a4b5 commit 7dfa3e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/UnifiedSpecTests/Operation.php
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,15 @@ private function executeForBucket(Bucket $bucket)

return stream_get_contents($bucket->openDownloadStream($args['id']));

case 'rename':
assertArrayHasKey('id', $args);
assertArrayHasKey('newFilename', $args);
assertIsString($args['newFilename']);

$bucket->rename($args['id'], $args['newFilename']);

return null;

case 'uploadWithId':
assertArrayHasKey('id', $args);
$args['_id'] = $args['id'];
Expand Down
1 change: 1 addition & 0 deletions tests/UnifiedSpecTests/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ final class Util
'delete' => ['id'],
'downloadByName' => ['filename', 'revision'],
'download' => ['id'],
'rename' => ['id', 'newFilename'],
'uploadWithId' => ['id', 'filename', 'source', 'chunkSizeBytes', 'disableMD5', 'contentType', 'metadata'],
'upload' => ['filename', 'source', 'chunkSizeBytes', 'disableMD5', 'contentType', 'metadata'],
],
Expand Down

0 comments on commit 7dfa3e8

Please sign in to comment.