Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion storage/src/move_object_atomic.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
10 changes: 4 additions & 6 deletions storage/test/ObjectsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,29 +153,27 @@ public function testManageObject()

public function testMoveObjectAtomic()
{
$bucketName = self::$bucketName . '-hns';
$objectName = 'test-object-' . time();
$newObjectName = $objectName . '-moved';
$bucket = self::$storage->createBucket($bucketName, [
'hierarchicalNamespace' => ['enabled' => true],
$bucket = self::$storage->createBucket(self::$bucketName, [
'iamConfiguration' => ['uniformBucketLevelAccess' => ['enabled' => true]]
]);

$object = $bucket->upload('test', ['name' => $objectName]);
$this->assertTrue($object->exists());

$output = self::runFunctionSnippet('move_object_atomic', [
$bucketName,
self::$bucketName,
$objectName,
$newObjectName
]);

$this->assertEquals(
sprintf(
'Moved gs://%s/%s to gs://%s/%s' . PHP_EOL,
$bucketName,
self::$bucketName,
$objectName,
$bucketName,
self::$bucketName,
$newObjectName
),
$output
Expand Down