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