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