Make WordPress Core

Changeset 52654


Ignore:
Timestamp:
01/30/2022 07:40:57 PM (3 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Switch to some more appropriate assertions.

See #54725

Location:
trunk/tests/phpunit/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/includes/factory.php

    r52010 r52654  
    99    public function test_create_creates_a_category() {
    1010        $id = $this->category_factory->create();
    11         $this->assertTrue( (bool) get_term_by( 'id', $id, 'category' ) );
     11        $this->assertInstanceOf( 'WP_Term', get_term_by( 'id', $id, 'category' ) );
    1212    }
    1313
    1414    public function test_get_object_by_id_gets_an_object() {
    1515        $id = $this->category_factory->create();
    16         $this->assertTrue( (bool) $this->category_factory->get_object_by_id( $id ) );
     16        $this->assertInstanceOf( 'WP_Term', $this->category_factory->get_object_by_id( $id ) );
    1717    }
    1818
  • trunk/tests/phpunit/tests/term.php

    r52389 r52654  
    124124
    125125        foreach ( $posts as $post_id ) {
    126             $this->assertTrue( (bool) wp_delete_post( $post_id ) );
     126            $this->assertInstanceOf( 'WP_Post', wp_delete_post( $post_id ) );
    127127        }
    128128    }
Note: See TracChangeset for help on using the changeset viewer.