feat(storage): support delete source objects on compose#2224
feat(storage): support delete source objects on compose#2224nidhiii-27 wants to merge 2 commits into
Conversation
Updates compose file sample to support deleting source objects optionally. Fixes b/441557254 [Generated-by: AI]
There was a problem hiding this comment.
Code Review
This pull request adds an optional $deleteSourceObjects parameter to the compose_file function, enabling the deletion of source objects after composition. The test suite has been updated with a data provider to cover both cases. The review feedback suggests replacing the assertEquals calls on boolean values with more idiomatic assertTrue and assertFalse assertions in the tests.
| $this->assertEquals(!$deleteSourceObjects, $bucket->object($object1Name)->exists()); | ||
| $this->assertEquals(!$deleteSourceObjects, $bucket->object($object2Name)->exists()); |
There was a problem hiding this comment.
Using assertEquals with a boolean value is a PHPUnit anti-pattern. It is more idiomatic and readable to use assertTrue or assertFalse directly, which also aligns with the assertion style used elsewhere in this test file.
if ($deleteSourceObjects) {
$this->assertFalse($bucket->object($object1Name)->exists());
$this->assertFalse($bucket->object($object2Name)->exists());
} else {
$this->assertTrue($bucket->object($object1Name)->exists());
$this->assertTrue($bucket->object($object2Name)->exists());
}There was a problem hiding this comment.
The rest of this file uses assertTrue() and assertFalse() when checking $object->exists(). Should we update this test case for consistency?
Removed trailing whitespaces in storage/test/ObjectsTest.php which caused the styles GitHub Actions check to fail. [Generated-by: AI]
| $this->assertEquals(!$deleteSourceObjects, $bucket->object($object1Name)->exists()); | ||
| $this->assertEquals(!$deleteSourceObjects, $bucket->object($object2Name)->exists()); |
There was a problem hiding this comment.
The rest of this file uses assertTrue() and assertFalse() when checking $object->exists(). Should we update this test case for consistency?
Updates compose file sample to support deleting source objects optionally. Fixes b/441557254
[Generated-by: AI]