Changeset 53533
- Timestamp:
- 06/20/2022 12:48:35 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/image/functions.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/functions.php
r53532 r53533 75 75 $this->assertTrue( 76 76 file_is_valid_image( DIR_TESTDATA . '/images/' . $file ), 77 "file_is_valid_image( '$file' ) should return true "77 "file_is_valid_image( '$file' ) should return true." 78 78 ); 79 79 } … … 119 119 $this->assertFalse( 120 120 file_is_valid_image( DIR_TESTDATA . '/images/' . $file ), 121 "file_is_valid_image( '$file' ) should return false "121 "file_is_valid_image( '$file' ) should return false." 122 122 ); 123 123 } … … 149 149 $this->assertTrue( 150 150 file_is_displayable_image( DIR_TESTDATA . '/images/' . $file ), 151 "file_is_displayable_image( '$file' ) should return true "151 "file_is_displayable_image( '$file' ) should return true." 152 152 ); 153 153 } … … 191 191 $this->assertFalse( 192 192 file_is_displayable_image( DIR_TESTDATA . '/images/' . $file ), 193 "file_is_displayable_image( '$file' ) should return false "193 "file_is_displayable_image( '$file' ) should return false." 194 194 ); 195 195 } … … 258 258 $loaded = $img->load(); 259 259 260 $this->assertNotWPError( $loaded, 'Image failed to load - WP_Error returned ' );260 $this->assertNotWPError( $loaded, 'Image failed to load - WP_Error returned.' ); 261 261 262 262 if ( ! $img->supports_mime_type( $mime_type ) ) { 263 263 $this->markTestSkipped( 264 264 sprintf( 265 'The %s mime type is not supported by the %s engine ',265 'The %s mime type is not supported by the %s engine.', 266 266 $mime_type, 267 267 str_replace( 'WP_Image_Editor_', '', $class_name ) … … 275 275 276 276 // Make assertions. 277 $this->assertNotEmpty( $ret, 'Image failed to save - "empty" response returned ' );278 $this->assertNotWPError( $ret, 'Image failed to save - WP_Error returned ' );279 $this->assertSame( $mime_type, $this->get_mime_type( $ret['path'] ), 'Mime type of the saved image does not match ' );277 $this->assertNotEmpty( $ret, 'Image failed to save - "empty" response returned.' ); 278 $this->assertNotWPError( $ret, 'Image failed to save - WP_Error returned.' ); 279 $this->assertSame( $mime_type, $this->get_mime_type( $ret['path'] ), 'Mime type of the saved image does not match.' ); 280 280 281 281 // Clean up. … … 335 335 $loaded = $img->load(); 336 336 337 $this->assertNotWPError( $loaded, 'Image failed to load - WP_Error returned ' );337 $this->assertNotWPError( $loaded, 'Image failed to load - WP_Error returned.' ); 338 338 339 339 // Save the file. … … 343 343 344 344 // Make assertions. 345 $this->assertNotEmpty( $ret, 'Image failed to save - "empty" response returned ' );346 $this->assertNotWPError( $ret, 'Image failed to save - WP_Error returned ' );347 $this->assertSame( $mime_type, $this->get_mime_type( $ret['path'] ), 'Mime type of the saved image did not override file name ' );345 $this->assertNotEmpty( $ret, 'Image failed to save - "empty" response returned.' ); 346 $this->assertNotWPError( $ret, 'Image failed to save - WP_Error returned.' ); 347 $this->assertSame( $mime_type, $this->get_mime_type( $ret['path'] ), 'Mime type of the saved image did not override file name.' ); 348 348 349 349 // Clean up. … … 380 380 $loaded = $img->load(); 381 381 382 $this->assertNotWPError( $loaded, 'Image failed to load - WP_Error returned ' );382 $this->assertNotWPError( $loaded, 'Image failed to load - WP_Error returned.' ); 383 383 384 384 if ( ! $img->supports_mime_type( $mime_type ) ) { 385 385 $this->markTestSkipped( 386 386 sprintf( 387 'The %s mime type is not supported by the %s engine ',387 'The %s mime type is not supported by the %s engine.', 388 388 $mime_type, 389 389 str_replace( 'WP_Image_Editor_', '', $class_name ) … … 398 398 399 399 // Make assertions. 400 $this->assertNotEmpty( $ret, 'Image failed to save - "empty" response returned ' );401 $this->assertNotWPError( $ret, 'Image failed to save - WP Error returned ' );402 $this->assertSame( $mime_type, $this->get_mime_type( $ret['path'] ), 'Mime type of the saved image was not inferred correctly ' );400 $this->assertNotEmpty( $ret, 'Image failed to save - "empty" response returned.' ); 401 $this->assertNotWPError( $ret, 'Image failed to save - WP Error returned.' ); 402 $this->assertSame( $mime_type, $this->get_mime_type( $ret['path'] ), 'Mime type of the saved image was not inferred correctly.' ); 403 403 404 404 // Clean up.
Note: See TracChangeset
for help on using the changeset viewer.