diff --git a/storage/composer.json b/storage/composer.json index 3c26e870f8..d77d3e2e74 100644 --- a/storage/composer.json +++ b/storage/composer.json @@ -1,6 +1,6 @@ { "require": { - "google/cloud-storage": "^1.48.3", + "google/cloud-storage": "^1.48.7", "paragonie/random_compat": "^9.0.0" }, "require-dev": { diff --git a/storage/src/move_object_atomic.php b/storage/src/move_object_atomic.php index 059ad7d2a1..3b76cbfc80 100644 --- a/storage/src/move_object_atomic.php +++ b/storage/src/move_object_atomic.php @@ -27,7 +27,7 @@ use Google\Cloud\Storage\StorageClient; /** - * Move an object to a new name within HNS-enabled bucket. + * Move an object to a new name within bucket. * * @param string $bucketName The name of your Cloud Storage bucket. * (e.g. 'my-bucket') diff --git a/storage/test/ObjectsTest.php b/storage/test/ObjectsTest.php index 5cf9ab3f3a..f88af49e04 100644 --- a/storage/test/ObjectsTest.php +++ b/storage/test/ObjectsTest.php @@ -151,13 +151,16 @@ public function testManageObject() $this->assertEquals($output, $outputString); } - public function testMoveObjectAtomic() + /** + * @dataProvider provideMoveObject + */ + public function testMoveObjectAtomic(bool $hnEnabled) { - $bucketName = self::$bucketName . '-hns'; + $bucketName = 'move-object-bucket-' . uniqid(); $objectName = 'test-object-' . time(); $newObjectName = $objectName . '-moved'; $bucket = self::$storage->createBucket($bucketName, [ - 'hierarchicalNamespace' => ['enabled' => true], + 'hierarchicalNamespace' => ['enabled' => $hnEnabled], 'iamConfiguration' => ['uniformBucketLevelAccess' => ['enabled' => true]] ]); @@ -189,6 +192,11 @@ public function testMoveObjectAtomic() $bucket->delete(); } + public function provideMoveObject() + { + return [[true], [false]]; + } + public function testCompose() { $bucket = self::$storage->bucket(self::$bucketName);