diff --git a/tests/phpunit/tests/post/wpInsertPost.php b/tests/phpunit/tests/post/wpInsertPost.php index 1b0838cf06..701a48bdea 100644 --- a/tests/phpunit/tests/post/wpInsertPost.php +++ b/tests/phpunit/tests/post/wpInsertPost.php @@ -128,7 +128,7 @@ class Tests_Post_wpInsertPost extends WP_UnitTestCase { $this->assertSame( $data['post_content'], $post->post_content ); $this->assertSame( $data['post_title'], $post->post_title ); $this->assertSame( $data['post_status'], $post->post_status ); - $this->assertEquals( $data['post_author'], $post->post_author ); + $this->assertSame( (string) $data['post_author'], $post->post_author ); // Test cache state. $post_cache = wp_cache_get( $post_id, 'posts' ); @@ -675,7 +675,7 @@ class Tests_Post_wpInsertPost extends WP_UnitTestCase { $this->assertGreaterThan( 0, $post_id ); $post = get_post( $post_id ); - $this->assertEquals( self::$user_ids['editor'], $post->post_author ); + $this->assertSame( (string) self::$user_ids['editor'], $post->post_author ); $this->assertSame( $title, $post->post_title ); } @@ -787,7 +787,7 @@ class Tests_Post_wpInsertPost extends WP_UnitTestCase { public function test_wp_insert_post_author_zero() { $post_id = self::factory()->post->create( array( 'post_author' => 0 ) ); - $this->assertEquals( 0, get_post( $post_id )->post_author ); + $this->assertSame( '0', get_post( $post_id )->post_author ); } /** @@ -798,7 +798,7 @@ class Tests_Post_wpInsertPost extends WP_UnitTestCase { $post_id = self::factory()->post->create( array( 'post_author' => null ) ); - $this->assertEquals( self::$user_ids['editor'], get_post( $post_id )->post_author ); + $this->assertSame( (string) self::$user_ids['editor'], get_post( $post_id )->post_author ); } /** @@ -916,7 +916,7 @@ class Tests_Post_wpInsertPost extends WP_UnitTestCase { // Validate that the post has had the default category assigned again. $this->assertCount( 1, $assigned_terms ); - $this->assertEquals( get_option( 'default_category' ), $assigned_terms[0]->term_id ); + $this->assertSame( (int) get_option( 'default_category' ), $assigned_terms[0]->term_id ); } /**