mirror of
git://develop.git.wordpress.org/
synced 2025-04-13 16:42:00 +02:00
Tests: Consistently check that an image was loaded in image saving tests.
Don't unnecessarily load the image twice in `test_inferred_mime_types_when_saving_an_image()`. Follow-up to [1061/tests], [1151/tests], [1157/tests], [29834]. See #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@53532 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a1c9ddabbd
commit
90caf2b35f
@ -257,6 +257,8 @@ class Tests_Image_Functions extends WP_UnitTestCase {
|
||||
$img = new $class_name( DIR_TESTDATA . '/images/canola.jpg' );
|
||||
$loaded = $img->load();
|
||||
|
||||
$this->assertNotWPError( $loaded, 'Image failed to load - WP_Error returned' );
|
||||
|
||||
if ( ! $img->supports_mime_type( $mime_type ) ) {
|
||||
$this->markTestSkipped(
|
||||
sprintf(
|
||||
@ -332,6 +334,8 @@ class Tests_Image_Functions extends WP_UnitTestCase {
|
||||
$img = new $class_name( DIR_TESTDATA . '/images/canola.jpg' );
|
||||
$loaded = $img->load();
|
||||
|
||||
$this->assertNotWPError( $loaded, 'Image failed to load - WP_Error returned' );
|
||||
|
||||
// Save the file.
|
||||
$mime_type = 'image/gif';
|
||||
$file = wp_tempnam( 'tmp.jpg' );
|
||||
@ -375,8 +379,7 @@ class Tests_Image_Functions extends WP_UnitTestCase {
|
||||
$img = new $class_name( DIR_TESTDATA . '/images/canola.jpg' );
|
||||
$loaded = $img->load();
|
||||
|
||||
$img = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' );
|
||||
$this->assertNotWPError( $img );
|
||||
$this->assertNotWPError( $loaded, 'Image failed to load - WP_Error returned' );
|
||||
|
||||
if ( ! $img->supports_mime_type( $mime_type ) ) {
|
||||
$this->markTestSkipped(
|
||||
|
Loading…
x
Reference in New Issue
Block a user