Make WordPress Core


Ignore:
Timestamp:
05/18/2021 09:04:31 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use assertInstanceOf() instead of assertTrue() in some tests.

See #52625.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/term/getTermBy.php

    r48937 r50926  
    126126                $num_queries++;
    127127
    128                 $this->assertTrue( $found instanceof WP_Term );
     128                $this->assertInstanceOf( 'WP_Term', $found );
    129129                $this->assertSame( $t, $found->term_id );
    130130                $this->assertSame( $num_queries, $wpdb->num_queries );
    … …  
    152152                $found = get_term_by( 'name', $term_name_slashed, 'wptests_tax' );
    153153
    154                 $this->assertTrue( $found instanceof WP_Term );
     154                $this->assertInstanceOf( 'WP_Term', $found );
    155155                $this->assertSame( $t, $found->term_id );
    156156                $this->assertSame( $term_name, $found->name );
    … …  
    172172                $found1 = get_term_by( 'slug', 'foo foo', 'wptests_tax' );
    173173
    174                 $this->assertTrue( $found1 instanceof WP_Term );
     174                $this->assertInstanceOf( 'WP_Term', $found1 );
    175175                $this->assertSame( $t1, $found1->term_id );
    176176
    … …  
    185185                $found2 = get_term_by( 'slug', '仪表盘', 'wptests_tax' );
    186186
    187                 $this->assertTrue( $found2 instanceof WP_Term );
     187                $this->assertInstanceOf( 'WP_Term', $found2 );
    188188                $this->assertSame( $t2, $found2->term_id );
    189189        }
Note: See TracChangeset for help on using the changeset viewer.