| @@ 230-237 (lines=8) @@ | ||
| 227 | */ |
|
| 228 | protected function test__master_user_exists_on_site() { |
|
| 229 | $name = __FUNCTION__; |
|
| 230 | if ( ! $this->helper_is_jetpack_connected() ) { |
|
| 231 | return self::skipped_test( |
|
| 232 | array( |
|
| 233 | 'name' => $name, |
|
| 234 | 'short_description' => __( 'Jetpack is not connected. No master user to check.', 'jetpack' ), |
|
| 235 | ) |
|
| 236 | ); |
|
| 237 | } |
|
| 238 | $local_user = $this->helper_retrieve_local_master_user(); |
|
| 239 | ||
| 240 | if ( $local_user->exists() ) { |
|
| @@ 265-272 (lines=8) @@ | ||
| 262 | */ |
|
| 263 | protected function test__master_user_can_manage_options() { |
|
| 264 | $name = __FUNCTION__; |
|
| 265 | if ( ! $this->helper_is_jetpack_connected() ) { |
|
| 266 | return self::skipped_test( |
|
| 267 | array( |
|
| 268 | 'name' => $name, |
|
| 269 | 'short_description' => __( 'Jetpack is not connected.', 'jetpack' ), |
|
| 270 | ) |
|
| 271 | ); |
|
| 272 | } |
|
| 273 | $master_user = $this->helper_retrieve_local_master_user(); |
|
| 274 | ||
| 275 | if ( user_can( $master_user, 'manage_options' ) ) { |
|
| @@ 372-379 (lines=8) @@ | ||
| 369 | */ |
|
| 370 | protected function test__identity_crisis() { |
|
| 371 | $name = __FUNCTION__; |
|
| 372 | if ( ! $this->helper_is_jetpack_connected() ) { |
|
| 373 | return self::skipped_test( |
|
| 374 | array( |
|
| 375 | 'name' => $name, |
|
| 376 | 'short_description' => __( 'Jetpack is not connected.', 'jetpack' ), |
|
| 377 | ) |
|
| 378 | ); |
|
| 379 | } |
|
| 380 | $identity_crisis = Jetpack::check_identity_crisis(); |
|
| 381 | ||
| 382 | if ( ! $identity_crisis ) { |
|
| @@ 492-499 (lines=8) @@ | ||
| 489 | ); |
|
| 490 | } |
|
| 491 | ||
| 492 | if ( 404 === wp_remote_retrieve_response_code( $response ) ) { |
|
| 493 | return self::skipped_test( |
|
| 494 | array( |
|
| 495 | 'name' => $name, |
|
| 496 | 'short_description' => __( 'The WordPress.com API returned a 404 error.', 'jetpack' ), |
|
| 497 | ) |
|
| 498 | ); |
|
| 499 | } |
|
| 500 | ||
| 501 | $result = json_decode( $body ); |
|
| 502 | $is_connected = ! empty( $result->connected ); |
|