Skip to content

Commit

Permalink
DRIVERS-3023 Add spec tests for GridFS Bucket rename
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Oct 30, 2024
1 parent f9dd433 commit bf9f933
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion tests/specifications

0 comments on commit bf9f933

Please sign in to comment.