Make WordPress Core


Ignore:
Timestamp:
09/22/2015 10:17:30 PM (9 years ago)
Author:
johnbillion
Message:

Add tests for some missing capabilities, including do_not_allow.

See #32394.

File:
1 edited

Legend:

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

    r34449 r34450  
    6262            'install_plugins'        => array( 'administrator' ),
    6363            'install_themes'         => array( 'administrator' ),
     64            'upload_plugins'         => array( 'administrator' ),
     65            'upload_themes'          => array( 'administrator' ),
    6466            'update_core'            => array( 'administrator' ),
    6567            'update_plugins'         => array( 'administrator' ),
    6668            'update_themes'          => array( 'administrator' ),
    6769            'edit_theme_options'     => array( 'administrator' ),
     70            'customize'              => array( 'administrator' ),
    6871            'export'                 => array( 'administrator' ),
    6972            'import'                 => array( 'administrator' ),
     
    141144            'install_plugins'        => array(),
    142145            'install_themes'         => array(),
     146            'upload_plugins'         => array(),
     147            'upload_themes'          => array(),
    143148            'update_core'            => array(),
    144149            'update_plugins'         => array(),
     
    146151
    147152            'edit_theme_options'     => array( 'administrator' ),
     153            'customize'              => array( 'administrator' ),
    148154            'export'                 => array( 'administrator' ),
    149155            'import'                 => array( 'administrator' ),
     
    244250
    245251        }
     252
     253        $this->assertFalse( $user->has_cap( 'do_not_allow' ), "User with the {$role} role should not have the do_not_allow capability" );
     254        $this->assertFalse( user_can( $user, 'do_not_allow' ), "User with the {$role} role should not have the do_not_allow capability" );
     255
    246256    }
    247257
     
    305315            $this->assertTrue( user_can( $user, $cap ), "Super Admins should have the {$cap} capability" );
    306316        }
     317
     318        $this->assertFalse( $user->has_cap( 'do_not_allow' ), 'Super Admins should not have the do_not_allow capability' );
     319        $this->assertFalse( user_can( $user, 'do_not_allow' ), 'Super Admins should not have the do_not_allow capability' );
    307320    }
    308321
Note: See TracChangeset for help on using the changeset viewer.