Changeset 52932 for trunk/tests/phpunit/tests/functions.php
- Timestamp:
- 03/14/2022 04:30:35 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/functions.php
r52328 r52932 2107 2107 $this->assertFalse( wp_get_default_extension_for_mime_type( null ), 'false not returned when null as mime type supplied' ); 2108 2108 } 2109 2110 /** 2111 * @ticket 49412 2112 * @covers ::wp_filesize 2113 */ 2114 function test_wp_filesize_with_nonexistent_file() { 2115 $file = 'nonexistent/file.jpg'; 2116 $this->assertEquals( 0, wp_filesize( $file ) ); 2117 } 2118 2119 /** 2120 * @ticket 49412 2121 * @covers ::wp_filesize 2122 */ 2123 function test_wp_filesize() { 2124 $file = DIR_TESTDATA . '/images/test-image-upside-down.jpg'; 2125 2126 $this->assertEquals( filesize( $file ), wp_filesize( $file ) ); 2127 2128 $filter = function() { 2129 return 999; 2130 }; 2131 2132 add_filter( 'wp_filesize', $filter ); 2133 2134 $this->assertEquals( 999, wp_filesize( $file ) ); 2135 2136 $pre_filter = function() { 2137 return 111; 2138 }; 2139 2140 add_filter( 'pre_wp_filesize', $pre_filter ); 2141 2142 $this->assertEquals( 111, wp_filesize( $file ) ); 2143 } 2109 2144 }
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)