WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/20/2018 10:34:11 PM (4 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/post/formats.php

    r42343 r42863  
    1616
    1717        $result = set_post_format( $post_id, 'aside' );
    18         $this->assertNotInstanceOf( 'WP_Error', $result );
     18        $this->assertNotWPError( $result );
    1919        $this->assertInternalType( 'array', $result );
    2020        $this->assertEquals( 1, count( $result ) );
     
    2424
    2525        $result = set_post_format( $post_id, 'standard' );
    26         $this->assertNotInstanceOf( 'WP_Error', $result );
     26        $this->assertNotWPError( $result );
    2727        $this->assertInternalType( 'array', $result );
    2828        $this->assertEquals( 0, count( $result ) );
    2929
    3030        $result = set_post_format( $post_id, '' );
    31         $this->assertNotInstanceOf( 'WP_Error', $result );
     31        $this->assertNotWPError( $result );
    3232        $this->assertInternalType( 'array', $result );
    3333        $this->assertEquals( 0, count( $result ) );
     
    4444
    4545        $result = set_post_format( $post_id, 'aside' );
    46         $this->assertNotInstanceOf( 'WP_Error', $result );
     46        $this->assertNotWPError( $result );
    4747        $this->assertInternalType( 'array', $result );
    4848        $this->assertEquals( 1, count( $result ) );
     
    5757
    5858        $result = set_post_format( $post_id, 'standard' );
    59         $this->assertNotInstanceOf( 'WP_Error', $result );
     59        $this->assertNotWPError( $result );
    6060        $this->assertInternalType( 'array', $result );
    6161        $this->assertEquals( 0, count( $result ) );
    6262
    6363        $result = set_post_format( $post_id, '' );
    64         $this->assertNotInstanceOf( 'WP_Error', $result );
     64        $this->assertNotWPError( $result );
    6565        $this->assertInternalType( 'array', $result );
    6666        $this->assertEquals( 0, count( $result ) );
     
    7676
    7777        $result = set_post_format( $post_id, 'aside' );
    78         $this->assertNotInstanceOf( 'WP_Error', $result );
     78        $this->assertNotWPError( $result );
    7979        $this->assertInternalType( 'array', $result );
    8080        $this->assertEquals( 1, count( $result ) );
     
    8282
    8383        $result = set_post_format( $post_id, 'standard' );
    84         $this->assertNotInstanceOf( 'WP_Error', $result );
     84        $this->assertNotWPError( $result );
    8585        $this->assertInternalType( 'array', $result );
    8686        $this->assertEquals( 0, count( $result ) );
Note: See TracChangeset for help on using the changeset viewer.