Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
yscik committed Jul 22, 2020
1 parent e9bb5ab commit 72d5a4f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ public function testGetImportNotStarted( $user_role, $is_authorized ) {

$expected_status_codes = [ 401, 403 ];
if ( $is_authorized ) {
$expected_status_codes = [ 404 ];
$expected_status_codes = [ 200 ];
}

$request = new WP_REST_Request( 'GET', '/sensei-internal/v1/import/active' );
$response = $this->server->dispatch( $request );
$this->assertTrue( in_array( $response->get_status(), $expected_status_codes, true ), "{$user_description} requests should produce status of " . implode( ', ', $expected_status_codes ) );

if ( $is_authorized ) {
$this->assertTrue( isset( $response->get_data()['code'] ) );
$this->assertEquals( 'sensei_data_port_job_not_found', $response->get_data()['code'] );
$this->assertTrue( isset( $response->get_data()['id'] ) );
$this->assertEquals( null, $response->get_data()['id'] );
}
}

Expand Down

0 comments on commit 72d5a4f

Please sign in to comment.