Make WordPress Core


Ignore:
Timestamp:
04/23/2017 09:57:31 PM (10 years ago)
Author:
johnbillion
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/user/wpAuthenticateSpamCheck.php

    r40520 r40543  
    1010         */
    1111        function test_wp_authenticate_spam_check_returns_user_when_single_site() {
    12                 if ( is_multisite() ) {
    13                         $this->markTestSkipped( 'This test applies to single site only.' );
    14                 }
     12                $this->skipWithMultisite();
    1513
    1614                $user_id = self::factory()->user->create( array( 'role' => 'contributor' ) );
    … …  
    2624         */
    2725        function test_wp_authenticate_spam_check_returns_user_when_not_flagged() {
    28                 if ( ! is_multisite() ) {
    29                         $this->markTestSkipped( 'This test applies to multisite only.' );
    30                 }
     26                $this->skipWithoutMultisite();
    3127
    3228                $user_id = self::factory()->user->create( array( 'role' => 'contributor' ) );
    … …  
    4238         */
    4339        function test_wp_authenticate_spam_check_returns_wp_error_when_flagged() {
    44                 if ( ! is_multisite() ) {
    45                         $this->markTestSkipped( 'This test applies to multisite only.' );
    46                 }
     40                $this->skipWithoutMultisite();
    4741
    4842                $user_id = self::factory()->user->create( array( 'role' => 'contributor' ) );
Note: See TracChangeset for help on using the changeset viewer.