| @@ 229-236 (lines=8) @@ | ||
| 226 | */ | |
| 227 | 	protected function test__master_user_exists_on_site() { | |
| 228 | $name = __FUNCTION__; | |
| 229 | 		if ( ! $this->helper_is_jetpack_connected() ) { | |
| 230 | return self::skipped_test( | |
| 231 | array( | |
| 232 | 'name' => $name, | |
| 233 | 'short_description' => __( 'Jetpack is not connected. No master user to check.', 'jetpack' ), | |
| 234 | ) | |
| 235 | ); | |
| 236 | } | |
| 237 | $local_user = $this->helper_retrieve_local_master_user(); | |
| 238 | ||
| 239 | 		if ( $local_user->exists() ) { | |
| @@ 264-271 (lines=8) @@ | ||
| 261 | */ | |
| 262 | 	protected function test__master_user_can_manage_options() { | |
| 263 | $name = __FUNCTION__; | |
| 264 | 		if ( ! $this->helper_is_jetpack_connected() ) { | |
| 265 | return self::skipped_test( | |
| 266 | array( | |
| 267 | 'name' => $name, | |
| 268 | 'short_description' => __( 'Jetpack is not connected.', 'jetpack' ), | |
| 269 | ) | |
| 270 | ); | |
| 271 | } | |
| 272 | $master_user = $this->helper_retrieve_local_master_user(); | |
| 273 | ||
| 274 | 		if ( user_can( $master_user, 'manage_options' ) ) { | |
| @@ 371-378 (lines=8) @@ | ||
| 368 | */ | |
| 369 | 	protected function test__identity_crisis() { | |
| 370 | $name = __FUNCTION__; | |
| 371 | 		if ( ! $this->helper_is_jetpack_connected() ) { | |
| 372 | return self::skipped_test( | |
| 373 | array( | |
| 374 | 'name' => $name, | |
| 375 | 'short_description' => __( 'Jetpack is not connected.', 'jetpack' ), | |
| 376 | ) | |
| 377 | ); | |
| 378 | } | |
| 379 | $identity_crisis = Jetpack::check_identity_crisis(); | |
| 380 | ||
| 381 | 		if ( ! $identity_crisis ) { | |
| @@ 447-454 (lines=8) @@ | ||
| 444 | ); | |
| 445 | } | |
| 446 | ||
| 447 | 		if ( 404 === wp_remote_retrieve_response_code( $response ) ) { | |
| 448 | return self::skipped_test( | |
| 449 | array( | |
| 450 | 'name' => $name, | |
| 451 | 'short_description' => __( 'The WordPress.com API returned a 404 error.', 'jetpack' ), | |
| 452 | ) | |
| 453 | ); | |
| 454 | } | |
| 455 | ||
| 456 | $result = json_decode( $body ); | |
| 457 | $is_connected = ! empty( $result->connected ); | |