| @@ 66-71 (lines=6) @@ | ||
| 63 | /** |
|
| 64 | * Testing the `POST /jetpack/v4/backup-helper-script` endpoint when the `helper` param is missing. |
|
| 65 | */ |
|
| 66 | public function test_install_backup_helper_script_missing_required_param() { |
|
| 67 | $request = new WP_REST_Request( 'POST', '/jetpack/v4/backup-helper-script' ); |
|
| 68 | $response = $this->server->dispatch( $request ); |
|
| 69 | $this->assertEquals( 400, $response->get_status() ); |
|
| 70 | $this->assertEquals( 'Missing parameter(s): helper', $response->get_data()['message'] ); |
|
| 71 | } |
|
| 72 | ||
| 73 | /** |
|
| 74 | * Testing the `POST /jetpack/v4/backup-helper-script` endpoint with admin user. |
|
| @@ 121-126 (lines=6) @@ | ||
| 118 | /** |
|
| 119 | * Testing the `DELETE /jetpack/v4/backup-helper-script` endpoint when the `path` param is missing. |
|
| 120 | */ |
|
| 121 | public function test_delete_backup_helper_script_missing_required_param() { |
|
| 122 | $request = new WP_REST_Request( 'DELETE', '/jetpack/v4/backup-helper-script' ); |
|
| 123 | $response = $this->server->dispatch( $request ); |
|
| 124 | $this->assertEquals( 400, $response->get_status() ); |
|
| 125 | $this->assertEquals( 'Missing parameter(s): path', $response->get_data()['message'] ); |
|
| 126 | } |
|
| 127 | ||
| 128 | /** |
|
| 129 | * Testing the `DELETE /jetpack/v4/backup-helper-script` endpoint with admin user. |
|
| @@ 180-187 (lines=8) @@ | ||
| 177 | /** |
|
| 178 | * Testing the `/jetpack/v4/identity-crisis/start-fresh` endpoint returns an error when user does not have permissions. |
|
| 179 | */ |
|
| 180 | public function test_start_fresh_no_access() { |
|
| 181 | $request = new WP_REST_Request( 'POST', '/jetpack/v4/identity-crisis/start-fresh' ); |
|
| 182 | $request->set_header( 'Content-Type', 'application/json' ); |
|
| 183 | ||
| 184 | $response = $this->server->dispatch( $request ); |
|
| 185 | ||
| 186 | $this->assertEquals( 401, $response->get_status() ); |
|
| 187 | } |
|
| 188 | ||
| 189 | } |
|
| 190 | ||