WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/22/2017 06:58:46 PM (2 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Introduce ms-required and ms-excluded groups for tests.

Tests in the ms-excluded group are now excluded when running tests with multisite enabled, and tests in the ms-required group are excluded when running tests without multisite enabled. The end result is a significantly reduced number of skipped tests polluting PHPUnit's output, which means verbose mode can be used to more easily see which tests are skipped or incomplete, and why.

See #40531

File:
1 edited

Legend:

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

    r40404 r40520  
    612612    }
    613613
     614    /**
     615     * @group ms-required
     616     */
    614617    function test_super_admin_caps() {
    615618        if ( ! is_multisite() ) {
    616619            $this->markTestSkipped( 'Test only runs in multisite' );
    617             return;
    618620        }
    619621        $caps = $this->getAllCapsAndRoles();
     
    13561358    }
    13571359
     1360    /**
     1361     * @group ms-required
     1362     */
    13581363    function test_borked_current_user_can_for_blog() {
    13591364        if ( ! is_multisite() ) {
    13601365            $this->markTestSkipped( 'Test only runs in multisite' );
    1361             return;
    13621366        }
    13631367
     
    14171421    }
    14181422
     1423    /**
     1424     * @group ms-required
     1425     */
    14191426    function test_multisite_administrator_can_not_edit_users() {
    14201427        if ( ! is_multisite() ) {
    14211428            $this->markTestSkipped( 'Test only runs in multisite' );
    1422             return;
    14231429        }
    14241430
     
    14511457    }
    14521458
     1459    /**
     1460     * @group ms-required
     1461     */
    14531462    public function test_only_super_admins_can_delete_users_on_multisite() {
    14541463        if ( ! is_multisite() ) {
     
    14651474    }
    14661475
     1476    /**
     1477     * @group ms-excluded
     1478     */
    14671479    public function test_only_admins_can_delete_users_on_single_site() {
    14681480        if ( is_multisite() ) {
     
    15231535    }
    15241536
     1537    /**
     1538     * @group ms-required
     1539     */
    15251540    function test_multisite_administrator_with_manage_network_users_can_edit_users() {
    15261541        if ( ! is_multisite() ) {
    15271542            $this->markTestSkipped( 'Test only runs in multisite' );
    1528             return;
    15291543        }
    15301544
     
    15421556    }
    15431557
     1558    /**
     1559     * @group ms-required
     1560     */
    15441561    function test_multisite_administrator_with_manage_network_users_can_not_edit_super_admin() {
    15451562        if ( ! is_multisite() ) {
    15461563            $this->markTestSkipped( 'Test only runs in multisite' );
    1547             return;
    15481564        }
    15491565
     
    17651781    /**
    17661782     * @ticket 39063
     1783     * @group ms-required
    17671784     */
    17681785    public function test_only_super_admins_can_remove_themselves_on_multisite() {
Note: See TracChangeset for help on using the changeset viewer.