Make WordPress Core


Ignore:
Timestamp:
03/20/2018 10:34:11 PM (6 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Implement assertNotWPError() in appropriate places in the test suite.

Props birgire

Fixes #42065

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/image/functions.php

    r42792 r42863  
    164164                $ret  = wp_save_image_file( $file, $img, $mime_type, 1 );
    165165                $this->assertNotEmpty( $ret );
    166                 $this->assertNotInstanceOf( 'WP_Error', $ret );
     166                $this->assertNotWPError( $ret );
    167167                $this->assertEquals( $mime_type, $this->get_mime_type( $ret['path'] ) );
    168168
     
    206206            // Make assertions
    207207            $this->assertNotEmpty( $ret );
    208             $this->assertNotInstanceOf( 'WP_Error', $ret );
     208            $this->assertNotWPError( $ret );
    209209            $this->assertEquals( $mime_type, $this->get_mime_type( $ret['path'] ) );
    210210
     
    250250            // Save the image as each file extension, check the mime type
    251251            $img = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' );
    252             $this->assertNotInstanceOf( 'WP_Error', $img );
     252            $this->assertNotWPError( $img );
    253253
    254254            $temp = get_temp_dir();
     
    261261                $ret  = $img->save( trailingslashit( $temp ) . $file );
    262262                $this->assertNotEmpty( $ret );
    263                 $this->assertNotInstanceOf( 'WP_Error', $ret );
     263                $this->assertNotWPError( $ret );
    264264                $this->assertEquals( $mime_type, $this->get_mime_type( $ret['path'] ) );
    265265                unlink( $ret['path'] );
     
    311311            0, 0, 100, 100, 100, 100
    312312        );
    313         $this->assertNotInstanceOf( 'WP_Error', $file );
     313        $this->assertNotWPError( $file );
    314314        $this->assertFileExists( $file );
    315315        $image = wp_get_image_editor( $file );
     
    335335            DIR_TESTDATA . '/images/' . __FUNCTION__ . '.jpg'
    336336        );
    337         $this->assertNotInstanceOf( 'WP_Error', $file );
     337        $this->assertNotWPError( $file );
    338338        $this->assertFileExists( $file );
    339339        $image = wp_get_image_editor( $file );
Note: See TracChangeset for help on using the changeset viewer.