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