feat(storage): support delete source objects on compose#2224
Draft
nidhiii-27 wants to merge 2 commits into
Draft
feat(storage): support delete source objects on compose#2224nidhiii-27 wants to merge 2 commits into
nidhiii-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.
Comment on lines
+303
to
+304
| $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());
}Removed trailing whitespaces in storage/test/ObjectsTest.php which caused the styles GitHub Actions check to fail. [Generated-by: AI]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates compose file sample to support deleting source objects optionally. Fixes b/441557254
[Generated-by: AI]