Skip to content

Commit 63699a9

Browse files
authored
docs: update move logic now to support non-HNS buckets (#8705)
1 parent 4a9423c commit 63699a9

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

Storage/src/StorageObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ public function rewrite($destination, array $options = [])
478478
}
479479

480480
/**
481-
* Move an object within a bucket with HNS enabled.
481+
* Move an object within a bucket.
482482
*
483483
* This method copies data using multiple requests so large objects can be
484484
* copied with a normal length timeout per request rather than one very long

Storage/tests/System/ManageObjectsTest.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,10 @@ public function testSoftDeleteHNSObject()
357357
$this->assertStorageObjectExists($softDeleteHNSBucket, $restoredObject);
358358
}
359359

360-
public function testMoveObject()
360+
/**
361+
* @dataProvider provideMoveObject
362+
*/
363+
public function testMoveObject(bool $hnEnabled)
361364
{
362365
$name = "move-object-bucket-" . uniqid();
363366
$sourceObjectName = uniqid(self::TESTING_PREFIX);
@@ -366,7 +369,7 @@ public function testMoveObject()
366369
self::$client,
367370
$name,
368371
[
369-
'hierarchicalNamespace' => ['enabled' => true,],
372+
'hierarchicalNamespace' => ['enabled' => $hnEnabled],
370373
'iamConfiguration' => ['uniformBucketLevelAccess' => ['enabled' => true]]
371374
]
372375
);
@@ -380,12 +383,17 @@ public function testMoveObject()
380383
// Move the object.
381384
$movedObject = $object->move($destinationObjectName);
382385

383-
// Assert that check existance of source and destination object.
386+
// Assert that check existence of source and destination object.
384387
$this->assertStorageObjectNotExists($sourceBucket, $object);
385388
$this->assertStorageObjectExists($sourceBucket, $movedObject);
386389
}
387390

388-
public function testRotatesCustomerSuppliedEncrpytion()
391+
public function provideMoveObject()
392+
{
393+
return [[true], [false]];
394+
}
395+
396+
public function testRotatesCustomerSuppliedEncryption()
389397
{
390398
$key = base64_encode(openssl_random_pseudo_bytes(32));
391399
$options = [

0 commit comments

Comments
 (0)