Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vagrant committed May 2, 2024
1 parent 4f06b62 commit 120ce66
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/unit/test-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 );
}
Expand Down

0 comments on commit 120ce66

Please sign in to comment.