Skip to content

Commit

Permalink
skip master user tests when in userless mode (#18887)
Browse files Browse the repository at this point in the history
  • Loading branch information
leogermani authored Feb 19, 2021
1 parent 1b7c775 commit 8193af7
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,14 @@ protected function test__master_user_exists_on_site() {
)
);
}
if ( ! ( new Connection_Manager() )->get_connection_owner_id() && ( new Status() )->is_no_user_testing_mode() ) {
return self::skipped_test(
array(
'name' => $name,
'short_description' => __( 'Jetpack is running in userless mode. No master user to check.', 'jetpack' ),
)
);
}
$local_user = $this->helper_retrieve_local_master_user();

if ( $local_user->exists() ) {
Expand Down Expand Up @@ -327,6 +335,14 @@ protected function test__master_user_can_manage_options() {
)
);
}
if ( ! ( new Connection_Manager() )->get_connection_owner_id() && ( new Status() )->is_no_user_testing_mode() ) {
return self::skipped_test(
array(
'name' => $name,
'short_description' => __( 'Jetpack is running in userless mode. No master user to check.', 'jetpack' ),
)
);
}
$master_user = $this->helper_retrieve_local_master_user();

if ( user_can( $master_user, 'manage_options' ) ) {
Expand Down

0 comments on commit 8193af7

Please sign in to comment.