Changeset 1120 in tests
- Timestamp:
- 11/08/2012 01:56:36 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/tests/image/functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/image/functions.php
r1075 r1120 220 220 } 221 221 } 222 223 /** 224 * Try loading a directory 225 * @ticket 17814 226 */ 227 public function test_load_directory() { 228 // First, test with deprecated wp_load_image function 229 $editor = wp_load_image( DIR_TESTDATA ); 230 $this->assertNotInternalType( 'resource', $editor ); 231 232 // Then, test with editors. 233 $classes = array('WP_Image_Editor_GD', 'WP_Image_Editor_Imagick'); 234 foreach ( $classes as $class ) { 235 if ( !$class::test() ) { 236 continue; 237 } 238 $filter = create_function( '', "return '$class';" ); 239 add_filter( 'image_editor_class', $filter ); 240 $editor = WP_Image_Editor::get_instance( DIR_TESTDATA ); 241 $this->assertInstanceOf( 'WP_Error', $editor ); 242 $this->assertEquals( 'error_loading_image', $editor->get_error_code() ); 243 } 244 } 222 245 }
Note: See TracChangeset
for help on using the changeset viewer.