From 82e44bc7021a2e20b59b9e38f485ab6a8a4a2f46 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sun, 15 Nov 2020 17:17:55 +0000 Subject: [PATCH] Build/Test Tools: Misc test enhancements. See #51344 git-svn-id: https://develop.svn.wordpress.org/trunk@49606 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/includes/testcase-rest-api.php | 2 +- tests/phpunit/tests/date/query.php | 3 +++ tests/phpunit/tests/rest-api/rest-autosaves-controller.php | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/includes/testcase-rest-api.php b/tests/phpunit/includes/testcase-rest-api.php index c857e0e392..5430d269d1 100644 --- a/tests/phpunit/includes/testcase-rest-api.php +++ b/tests/phpunit/includes/testcase-rest-api.php @@ -7,7 +7,7 @@ abstract class WP_Test_REST_TestCase extends WP_UnitTestCase { $response = $response->as_error(); } - $this->assertInstanceOf( 'WP_Error', $response ); + $this->assertWPError( $response ); $this->assertEquals( $code, $response->get_error_code() ); if ( null !== $status ) { diff --git a/tests/phpunit/tests/date/query.php b/tests/phpunit/tests/date/query.php index 0445fd819f..fe31577e04 100644 --- a/tests/phpunit/tests/date/query.php +++ b/tests/phpunit/tests/date/query.php @@ -9,6 +9,9 @@ * @group date */ class Tests_WP_Date_Query extends WP_UnitTestCase { + /** + * @var WP_Date_Query $q + */ public $q; public function setUp() { diff --git a/tests/phpunit/tests/rest-api/rest-autosaves-controller.php b/tests/phpunit/tests/rest-api/rest-autosaves-controller.php index 609fbb73c9..0984bd3f83 100644 --- a/tests/phpunit/tests/rest-api/rest-autosaves-controller.php +++ b/tests/phpunit/tests/rest-api/rest-autosaves-controller.php @@ -38,7 +38,7 @@ class WP_Test_REST_Autosaves_Controller extends WP_Test_REST_Post_Type_Controlle } protected function check_create_autosave_response( $response ) { - $this->assertNotInstanceOf( 'WP_Error', $response ); + $this->assertNotWPError( $response ); $response = rest_ensure_response( $response ); $data = $response->get_data();