Skip to content

Commit

Permalink
Subroles: Switch to Central to fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
iandunn committed Jul 26, 2023
1 parent 5b0dd65 commit c73d2cf
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public function test_user_with_additional_caps_cannot() {
public function test_user_with_subrole_can( $subrole, $primitive_cap, $meta_cap ) {
global $wcorg_subroles;

// Some caps are only applied on Central.
switch_to_blog( WORDCAMP_ROOT_BLOG_ID );

$user = self::factory()->user->create_and_get( array(
'role' => 'subscriber',
) );
Expand All @@ -69,6 +72,8 @@ public function test_user_with_subrole_can( $subrole, $primitive_cap, $meta_cap
$this->assertTrue( $user->has_cap( 'read' ) );
$this->assertTrue( $user->has_cap( $primitive_cap ) );
$this->assertTrue( user_can( $user->ID, $meta_cap ) );

restore_current_blog();
}

/**
Expand Down

0 comments on commit c73d2cf

Please sign in to comment.