From bf9f9337732818fc1f368d2c3f35d867bfecf2b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Wed, 30 Oct 2024 13:01:22 +0100 Subject: [PATCH] DRIVERS-3023 Add spec tests for GridFS Bucket rename --- tests/UnifiedSpecTests/Operation.php | 9 +++++++++ tests/UnifiedSpecTests/Util.php | 1 + tests/specifications | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/UnifiedSpecTests/Operation.php b/tests/UnifiedSpecTests/Operation.php index cc7cd703a..390e278be 100644 --- a/tests/UnifiedSpecTests/Operation.php +++ b/tests/UnifiedSpecTests/Operation.php @@ -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']; diff --git a/tests/UnifiedSpecTests/Util.php b/tests/UnifiedSpecTests/Util.php index 4f2fb22f1..e09e3f942 100644 --- a/tests/UnifiedSpecTests/Util.php +++ b/tests/UnifiedSpecTests/Util.php @@ -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'], ], diff --git a/tests/specifications b/tests/specifications index 9058491f2..901d1e75d 160000 --- a/tests/specifications +++ b/tests/specifications @@ -1 +1 @@ -Subproject commit 9058491f2d5b5651913a56e373121a24d6498673 +Subproject commit 901d1e75dfab5931fe38b2fbfce477dad70e1a17