Skip to content

Commit 458d94c

Browse files
Add value assertion for metadata file key
Addresses review feedback to assert the value of metadata['file'], not just its existence.
1 parent 02a9794 commit 458d94c

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

tests/phpunit/tests/rest-api/rest-attachments-controller.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3202,6 +3202,7 @@ public function test_sideload_scaled_image() {
32023202
$this->assertArrayHasKey( 'height', $metadata, 'Metadata should contain height.' );
32033203
$this->assertArrayHasKey( 'filesize', $metadata, 'Metadata should contain filesize.' );
32043204
$this->assertArrayHasKey( 'file', $metadata, 'Metadata should contain file.' );
3205+
$this->assertStringContainsString( 'scaled', $metadata['file'], 'Metadata file should reference the scaled version.' );
32053206
$this->assertGreaterThan( 0, $metadata['width'], 'Width should be positive.' );
32063207
$this->assertGreaterThan( 0, $metadata['height'], 'Height should be positive.' );
32073208
$this->assertGreaterThan( 0, $metadata['filesize'], 'Filesize should be positive.' );

0 commit comments

Comments
 (0)