Changeset 55278 for trunk/tests/phpunit/tests/media.php
- Timestamp:
- 02/07/2023 05:22:41 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/media.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/media.php
r55171 r55278 3772 3772 3773 3773 /** 3774 * Test that an image size isn't generated if it matches the original image size. 3775 */ 3776 public function test_wp_generate_attachment_metadata_doesnt_generate_sizes_for_150_square_image() { 3777 $temp_dir = get_temp_dir(); 3778 $file = $temp_dir . '/test-square-150.jpg'; 3779 copy( DIR_TESTDATA . '/images/test-square-150.jpg', $file ); 3780 3781 $attachment_id = self::factory()->attachment->create_object( 3782 array( 3783 'post_mime_type' => 'image/jpeg', 3784 'file' => $file, 3785 ) 3786 ); 3787 3788 $metadata = wp_generate_attachment_metadata( $attachment_id, $file ); 3789 $this->assertEquals( 3790 array(), 3791 $metadata['sizes'] 3792 ); 3793 $this->assertEquals( 3794 'test-square-150.jpg', 3795 basename( $metadata['file'] ) 3796 ); 3797 $this->assertEquals( 3798 '150', 3799 $metadata['width'] 3800 ); 3801 $this->assertEquals( 3802 '150', 3803 $metadata['height'] 3804 ); 3805 } 3806 3807 /** 3774 3808 * Add threshold to create a `-scaled` output image for testing. 3775 3809 */
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)