WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/01/2017 08:34:10 PM (2 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Automatically skip tests in the ms-required and ms-excluded groups.

This removes the need to manually call $this->skipWithMultisite() and $this->skipWithoutMultisite() from within the test when the test only runs without Multisite or only runs on Multisite, respectively.

Props jdgrimes for the suggestion.

Fixes #40531

File:
1 edited

Legend:

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

    r40563 r40564  
    616616     */
    617617    function test_super_admin_caps() {
    618         $this->skipWithoutMultisite();
    619 
    620618        $caps = $this->getAllCapsAndRoles();
    621619        $user = self::$super_admin;
     
    13611359     */
    13621360    function test_borked_current_user_can_for_blog() {
    1363         $this->skipWithoutMultisite();
    1364 
    13651361        $orig_blog_id = get_current_blog_id();
    13661362        $blog_id = self::factory()->blog->create();
     
    14221418     */
    14231419    function test_multisite_administrator_can_not_edit_users() {
    1424         $this->skipWithoutMultisite();
    1425 
    14261420        $user = self::$users['administrator'];
    14271421        $other_user = self::$users['subscriber'];
     
    14561450     */
    14571451    public function test_only_super_admins_can_delete_users_on_multisite() {
    1458         $this->skipWithoutMultisite();
    1459 
    14601452        $this->assertTrue( user_can( self::$super_admin->ID,             'delete_user', self::$users['subscriber']->ID ) );
    14611453
     
    14711463     */
    14721464    public function test_only_admins_can_delete_users_on_single_site() {
    1473         $this->skipWithMultisite();
    1474 
    14751465        $this->assertTrue( user_can( self::$users['administrator']->ID, 'delete_user', self::$users['subscriber']->ID ) );
    14761466
     
    15301520     */
    15311521    function test_multisite_administrator_with_manage_network_users_can_edit_users() {
    1532         $this->skipWithoutMultisite();
    1533 
    15341522        $user = self::$users['administrator'];
    15351523        $user->add_cap( 'manage_network_users' );
     
    15491537     */
    15501538    function test_multisite_administrator_with_manage_network_users_can_not_edit_super_admin() {
    1551         $this->skipWithoutMultisite();
    1552 
    15531539        $user = self::$users['administrator'];
    15541540        $user->add_cap( 'manage_network_users' );
     
    17751761     */
    17761762    public function test_only_super_admins_can_remove_themselves_on_multisite() {
    1777         $this->skipWithoutMultisite();
    1778 
    17791763        $this->assertTrue( user_can( self::$super_admin->ID, 'remove_user', self::$super_admin->ID ) );
    17801764
Note: See TracChangeset for help on using the changeset viewer.