diff --git a/tests/phpunit/tests/formatting/SanitizePost.php b/tests/phpunit/tests/formatting/SanitizePost.php index 3034ebbd02d1..7c827f4c4f66 100644 --- a/tests/phpunit/tests/formatting/SanitizePost.php +++ b/tests/phpunit/tests/formatting/SanitizePost.php @@ -9,17 +9,12 @@ class Tests_Formatting_SanitizePost extends WP_UnitTestCase { * @ticket 22324 */ function test_int_fields() { - $post = self::factory()->post->create_and_get(); - $int_fields = array( - 'ID' => 'integer', - 'post_parent' => 'integer', - 'menu_order' => 'integer', - 'post_author' => 'string', - 'comment_count' => 'string', - ); + $post = self::factory()->post->create_and_get(); - foreach ( $int_fields as $field => $type ) { - $this->assertInternalType( $type, $post->$field, "field $field" ); - } + $this->assertIsInt( $post->ID, 'field ID' ); + $this->assertIsInt( $post->post_parent, 'field post_parent' ); + $this->assertIsInt( $post->menu_order, 'field menu_order' ); + $this->assertIsString( $post->post_author, 'field post_author' ); + $this->assertIsString( $post->comment_count, 'field comment_count' ); } }