Changeset 54226 for trunk/tests/phpunit/tests/image/editor.php
- Timestamp:
- 09/19/2022 10:51:53 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/editor.php
r54086 r54226 19 19 20 20 require_once DIR_TESTDATA . '/../includes/mock-image-editor.php'; 21 add_filter( 'image_editor_output_format', '__return_empty_array' );22 21 23 22 // This needs to come after the mock image editor class is loaded. 24 23 parent::set_up(); 25 }26 27 /**28 * Tear down the class.29 */30 public function tear_down() {31 remove_filter( 'image_editor_output_format', '__return_empty_array' );32 parent::tear_down();33 24 } 34 25 … … 236 227 237 228 // Test with a suffix only. 238 $this->assertSame( 'canola-100x50 -jpg.png', wp_basename( $editor->generate_filename( null, null, 'png' ) ) );229 $this->assertSame( 'canola-100x50.png', wp_basename( $editor->generate_filename( null, null, 'png' ) ) ); 239 230 240 231 // Combo! 241 $this->assertSame( trailingslashit( realpath( get_temp_dir() ) ) . 'canola-new -jpg.png', $editor->generate_filename( 'new', realpath( get_temp_dir() ), 'png' ) );232 $this->assertSame( trailingslashit( realpath( get_temp_dir() ) ) . 'canola-new.png', $editor->generate_filename( 'new', realpath( get_temp_dir() ), 'png' ) ); 242 233 243 234 // Test with a stream destination.
Note: See TracChangeset
for help on using the changeset viewer.