From 24b83dd431179c79b7fdba3080e04da8c3e50b0c Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sun, 30 Jan 2022 19:40:57 +0000 Subject: [PATCH] Build/Test Tools: Switch to some more appropriate assertions. See #54725 git-svn-id: https://develop.svn.wordpress.org/trunk@52654 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/includes/factory.php | 4 ++-- tests/phpunit/tests/term.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/tests/includes/factory.php b/tests/phpunit/tests/includes/factory.php index c1ab1c2a0d..ac5410cf55 100644 --- a/tests/phpunit/tests/includes/factory.php +++ b/tests/phpunit/tests/includes/factory.php @@ -8,12 +8,12 @@ class TestFactoryFor extends WP_UnitTestCase { public function test_create_creates_a_category() { $id = $this->category_factory->create(); - $this->assertTrue( (bool) get_term_by( 'id', $id, 'category' ) ); + $this->assertInstanceOf( 'WP_Term', get_term_by( 'id', $id, 'category' ) ); } public function test_get_object_by_id_gets_an_object() { $id = $this->category_factory->create(); - $this->assertTrue( (bool) $this->category_factory->get_object_by_id( $id ) ); + $this->assertInstanceOf( 'WP_Term', $this->category_factory->get_object_by_id( $id ) ); } public function test_get_object_by_id_gets_an_object_with_the_same_name() { diff --git a/tests/phpunit/tests/term.php b/tests/phpunit/tests/term.php index 737047bdd1..4cc0701097 100644 --- a/tests/phpunit/tests/term.php +++ b/tests/phpunit/tests/term.php @@ -123,7 +123,7 @@ class Tests_Term extends WP_UnitTestCase { } foreach ( $posts as $post_id ) { - $this->assertTrue( (bool) wp_delete_post( $post_id ) ); + $this->assertInstanceOf( 'WP_Post', wp_delete_post( $post_id ) ); } }