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