mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Build/Test Tools: Introduce skipWithoutMultisite() and skipWithMultisite() methods into the test suite.
This brings much needed uniformity to test skipping when a test requires Multisite or when a test should be excluded from running when Multisite is enabled. Used in conjunction with the `@group ms-required` and `@group ms-excluded` notation, this removes a significant number of skipped tests from the default test suite run. Fixes #40531 git-svn-id: https://develop.svn.wordpress.org/trunk@40543 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -9,9 +9,7 @@ class Tests_User_WpAuthenticateSpamCheck extends WP_UnitTestCase {
|
||||
* @group ms-excluded
|
||||
*/
|
||||
function test_wp_authenticate_spam_check_returns_user_when_single_site() {
|
||||
if ( is_multisite() ) {
|
||||
$this->markTestSkipped( 'This test applies to single site only.' );
|
||||
}
|
||||
$this->skipWithMultisite();
|
||||
|
||||
$user_id = self::factory()->user->create( array( 'role' => 'contributor' ) );
|
||||
$user = new WP_User( $user_id );
|
||||
@@ -25,9 +23,7 @@ class Tests_User_WpAuthenticateSpamCheck extends WP_UnitTestCase {
|
||||
* @group ms-required
|
||||
*/
|
||||
function test_wp_authenticate_spam_check_returns_user_when_not_flagged() {
|
||||
if ( ! is_multisite() ) {
|
||||
$this->markTestSkipped( 'This test applies to multisite only.' );
|
||||
}
|
||||
$this->skipWithoutMultisite();
|
||||
|
||||
$user_id = self::factory()->user->create( array( 'role' => 'contributor' ) );
|
||||
$user = new WP_User( $user_id );
|
||||
@@ -41,9 +37,7 @@ class Tests_User_WpAuthenticateSpamCheck extends WP_UnitTestCase {
|
||||
* @group ms-required
|
||||
*/
|
||||
function test_wp_authenticate_spam_check_returns_wp_error_when_flagged() {
|
||||
if ( ! is_multisite() ) {
|
||||
$this->markTestSkipped( 'This test applies to multisite only.' );
|
||||
}
|
||||
$this->skipWithoutMultisite();
|
||||
|
||||
$user_id = self::factory()->user->create( array( 'role' => 'contributor' ) );
|
||||
update_user_status( $user_id, 'spam', 1 );
|
||||
|
||||
Reference in New Issue
Block a user