Changeset 53523
- Timestamp:
- 06/19/2022 03:13:16 PM (3 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/image/functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/functions.php
r53522 r53523 64 64 } 65 65 66 public function test_is_image_positive() { 66 /** 67 * @dataProvider data_is_image_positive 68 * 69 * @covers ::file_is_valid_image 70 * @covers ::wp_getimagesize 71 * 72 * @param string $file File name. 73 */ 74 public function test_is_image_positive( $file ) { 75 $this->assertTrue( 76 file_is_valid_image( DIR_TESTDATA . '/images/' . $file ), 77 "file_is_valid_image( '$file' ) should return true" 78 ); 79 } 80 81 /** 82 * Data Provider. 83 * 84 * @return array 85 */ 86 public function data_is_image_positive() { 67 87 // These are all image files recognized by PHP. 68 88 $files = array( … … 78 98 'test-image-zip.tiff', 79 99 'test-image.jpg', 100 'test-image.ico', 80 101 'webp-animated.webp', 81 102 'webp-lossless.webp', … … 84 105 ); 85 106 86 // IMAGETYPE_ICO is only defined in PHP 5.3+. 87 if ( defined( 'IMAGETYPE_ICO' ) ) { 88 $files[] = 'test-image.ico'; 89 } 90 91 foreach ( $files as $file ) { 92 $this->assertTrue( file_is_valid_image( DIR_TESTDATA . '/images/' . $file ), "file_is_valid_image($file) should return true" ); 93 } 107 return $this->text_array_to_dataprovider( $files ); 94 108 } 95 109
Note: See TracChangeset
for help on using the changeset viewer.