From c73d2cfa9a61e922b67e1772db92708dcd32f6fa Mon Sep 17 00:00:00 2001 From: Ian Dunn Date: Tue, 25 Jul 2023 17:38:27 -0700 Subject: [PATCH] Subroles: Switch to Central to fix test --- .../wp-content/mu-plugins/tests/test-wcorg-subroles.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public_html/wp-content/mu-plugins/tests/test-wcorg-subroles.php b/public_html/wp-content/mu-plugins/tests/test-wcorg-subroles.php index cd35f0fd1..e05e735e7 100644 --- a/public_html/wp-content/mu-plugins/tests/test-wcorg-subroles.php +++ b/public_html/wp-content/mu-plugins/tests/test-wcorg-subroles.php @@ -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', ) ); @@ -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(); } /**