WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/23/2017 09:57:31 PM (2 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/general/template.php

    r40520 r40543  
    7676     */
    7777    function test_has_site_icon_returns_true_when_called_for_other_site_with_site_icon_set() {
    78         if ( ! is_multisite() ) {
    79             $this->markTestSkipped( 'This test requires multisite.' );
    80         }
     78        $this->skipWithoutMultisite();
    8179
    8280        $blog_id = $this->factory->blog->create();
     
    9492     */
    9593    function test_has_site_icon_returns_false_when_called_for_other_site_without_site_icon_set() {
    96         if ( ! is_multisite() ) {
    97             $this->markTestSkipped( 'This test requires multisite.' );
    98         }
     94        $this->skipWithoutMultisite();
    9995
    10096        $blog_id = $this->factory->blog->create();
     
    270266     */
    271267    function test_has_custom_logo_returns_true_when_called_for_other_site_with_custom_logo_set() {
    272         if ( ! is_multisite() ) {
    273             $this->markTestSkipped( 'This test requires multisite.' );
    274         }
     268        $this->skipWithoutMultisite();
    275269
    276270        $blog_id = $this->factory->blog->create();
     
    288282     */
    289283    function test_has_custom_logo_returns_false_when_called_for_other_site_without_custom_logo_set() {
    290         if ( ! is_multisite() ) {
    291             $this->markTestSkipped( 'This test requires multisite.' );
    292         }
     284        $this->skipWithoutMultisite();
    293285
    294286        $blog_id = $this->factory->blog->create();
     
    320312     */
    321313    function test_get_custom_logo_returns_logo_when_called_for_other_site_with_custom_logo_set() {
    322         if ( ! is_multisite() ) {
    323             $this->markTestSkipped( 'This test requires multisite.' );
    324         }
     314        $this->skipWithoutMultisite();
    325315
    326316        $blog_id = $this->factory->blog->create();
     
    543533     */
    544534    function test_get_site_icon_url_preserves_switched_state() {
    545         if ( ! is_multisite() ) {
    546             $this->markTestSkipped( 'This test requires multisite.' );
    547         }
     535        $this->skipWithoutMultisite();
    548536
    549537        $blog_id = $this->factory->blog->create();
     
    566554     */
    567555    function test_has_custom_logo_preserves_switched_state() {
    568         if ( ! is_multisite() ) {
    569             $this->markTestSkipped( 'This test requires multisite.' );
    570         }
     556        $this->skipWithoutMultisite();
    571557
    572558        $blog_id = $this->factory->blog->create();
     
    589575     */
    590576    function test_get_custom_logo_preserves_switched_state() {
    591         if ( ! is_multisite() ) {
    592             $this->markTestSkipped( 'This test requires multisite.' );
    593         }
     577        $this->skipWithoutMultisite();
    594578
    595579        $blog_id = $this->factory->blog->create();
Note: See TracChangeset for help on using the changeset viewer.