mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 06:37:06 +00:00
Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( isset( ... ) )` with `assertArrayHasKey()` to use native PHPUnit functionality. Follow-up to [51335], [51337], [51367]. See #53363. git-svn-id: https://develop.svn.wordpress.org/trunk@51397 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -647,7 +647,7 @@ class Tests_Image_Functions extends WP_UnitTestCase {
|
||||
);
|
||||
|
||||
$metadata = wp_generate_attachment_metadata( $attachment_id, $test_file );
|
||||
$this->assertTrue( isset( $metadata['sizes']['test-size'] ), 'The `test-size` was not added to the metadata.' );
|
||||
$this->assertArrayHasKey( 'test-size', $metadata['sizes'], 'The `test-size` was not added to the metadata.' );
|
||||
$this->assertSame( $metadata['sizes']['test-size'], $expected );
|
||||
|
||||
remove_image_size( 'test-size' );
|
||||
|
||||
Reference in New Issue
Block a user