Make WordPress Core


Ignore:
Timestamp:
04/23/2017 09:57:31 PM (9 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/theme/WPTheme.php

    r40520 r40543  
    149149         */
    150150        function test_wp_theme_network_enable_single_theme() {
    151                 if ( ! is_multisite() ) {
    152                         $this->markTestSkipped( 'This test requires multisite' );
    153                 }
     151                $this->skipWithoutMultisite();
    154152
    155153                $theme = 'testtheme-1';
     
    170168         */
    171169        function test_wp_theme_network_enable_multiple_themes() {
    172                 if ( ! is_multisite() ) {
    173                         $this->markTestSkipped( 'This test requires multisite' );
    174                 }
     170                $this->skipWithoutMultisite();
    175171
    176172                $themes = array( 'testtheme-2', 'testtheme-3' );
     
    191187         */
    192188        function test_network_disable_single_theme() {
    193                 if ( ! is_multisite() ) {
    194                         $this->markTestSkipped( 'This test requires multisite' );
    195                 }
     189                $this->skipWithoutMultisite();
    196190
    197191                $current_allowed_themes = get_site_option( 'allowedthemes' );
     
    216210         */
    217211        function test_network_disable_multiple_themes() {
    218                 if ( ! is_multisite() ) {
    219                         $this->markTestSkipped( 'This test requires multisite' );
    220                 }
     212                $this->skipWithoutMultisite();
    221213
    222214                $current_allowed_themes = get_site_option( 'allowedthemes' );
Note: See TracChangeset for help on using the changeset viewer.