| @@ 185-192 (lines=8) @@ | ||
| 182 | */ |
|
| 183 | protected function test__master_user_exists_on_site() { |
|
| 184 | $name = __FUNCTION__; |
|
| 185 | if ( ! $this->helper_is_jetpack_connected() ) { |
|
| 186 | return self::skipped_test( |
|
| 187 | array( |
|
| 188 | 'name' => $name, |
|
| 189 | 'short_description' => __( 'Jetpack is not connected. No master user to check.', 'jetpack' ), |
|
| 190 | ) |
|
| 191 | ); |
|
| 192 | } |
|
| 193 | $local_user = $this->helper_retrieve_local_master_user(); |
|
| 194 | ||
| 195 | if ( $local_user->exists() ) { |
|
| @@ 220-227 (lines=8) @@ | ||
| 217 | */ |
|
| 218 | protected function test__master_user_can_manage_options() { |
|
| 219 | $name = __FUNCTION__; |
|
| 220 | if ( ! $this->helper_is_jetpack_connected() ) { |
|
| 221 | return self::skipped_test( |
|
| 222 | array( |
|
| 223 | 'name' => $name, |
|
| 224 | 'short_description' => __( 'Jetpack is not connected.', 'jetpack' ), |
|
| 225 | ) |
|
| 226 | ); |
|
| 227 | } |
|
| 228 | $master_user = $this->helper_retrieve_local_master_user(); |
|
| 229 | ||
| 230 | if ( user_can( $master_user, 'manage_options' ) ) { |
|
| @@ 327-334 (lines=8) @@ | ||
| 324 | */ |
|
| 325 | protected function test__identity_crisis() { |
|
| 326 | $name = __FUNCTION__; |
|
| 327 | if ( ! $this->helper_is_jetpack_connected() ) { |
|
| 328 | return self::skipped_test( |
|
| 329 | array( |
|
| 330 | 'name' => $name, |
|
| 331 | 'short_description' => __( 'Jetpack is not connected.', 'jetpack' ), |
|
| 332 | ) |
|
| 333 | ); |
|
| 334 | } |
|
| 335 | $identity_crisis = Jetpack::check_identity_crisis(); |
|
| 336 | ||
| 337 | if ( ! $identity_crisis ) { |
|
| @@ 403-410 (lines=8) @@ | ||
| 400 | ); |
|
| 401 | } |
|
| 402 | ||
| 403 | if ( 404 === wp_remote_retrieve_response_code( $response ) ) { |
|
| 404 | return self::skipped_test( |
|
| 405 | array( |
|
| 406 | 'name' => $name, |
|
| 407 | 'short_description' => __( 'The WordPress.com API returned a 404 error.', 'jetpack' ), |
|
| 408 | ) |
|
| 409 | ); |
|
| 410 | } |
|
| 411 | ||
| 412 | $result = json_decode( $body ); |
|
| 413 | $is_connected = (bool) $result->connected; |
|