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/link/getDashboardUrl.php

    r40520 r40543  
    4242     */
    4343    public function test_get_dashboard_url_for_network_administrator_with_no_sites() {
    44         if ( ! is_multisite() ) {
    45             $this->markTestSkipped( 'Test only runs in multisite.' );
    46         }
     44        $this->skipWithoutMultisite();
    4745
    4846        grant_super_admin( self::$user_id );
     
    6361     */
    6462    public function test_get_dashboard_url_for_administrator_of_different_site() {
    65         if ( ! is_multisite() ) {
    66             $this->markTestSkipped( 'Test only runs in multisite.' );
    67         }
     63        $this->skipWithoutMultisite();
    6864
    6965        $site_id = self::factory()->blog->create( array( 'user_id' => self::$user_id ) );
Note: See TracChangeset for help on using the changeset viewer.