From 120ce667bb3d4c6fb72db0a5bdcc1f90a3d52cce Mon Sep 17 00:00:00 2001 From: vagrant Date: Thu, 2 May 2024 00:56:14 +0000 Subject: [PATCH] fixing tests --- tests/unit/test-service.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/test-service.php b/tests/unit/test-service.php index 159f014..fd96960 100644 --- a/tests/unit/test-service.php +++ b/tests/unit/test-service.php @@ -36,7 +36,7 @@ class Test_Service extends TestCase { * Set up. */ public function setup(): void { - add_action( 'rest_api_init', [ $this, 'register_rest_routes' ] ); + \add_action( 'rest_api_init', [ $this, 'register_rest_routes' ] ); parent::setup(); } @@ -137,7 +137,7 @@ public function data_test_get_response(): array { [ 'body' => 'grapefruit', 'filter_callback_before_request' => function ( $value ) { - $value['body'] = 'pear'; + $value = 'pear'; return $value; }, 'filter_callback_after_request' => fn( $value ) => $value, @@ -184,7 +184,7 @@ public function test_get_response( array $original, string $expected ): void { add_filter( 'wp_proxy_service_response_after_request', $original['filter_callback_after_request'] ); $result = $method->invoke( $service, $request, 'https://example.org' ); - $body = $result->get_data()['body'] ?? ''; + $body = $result->get_data() ?? ''; $this->assertEquals( $expected, $body ); }