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/adminbar.php

    r40543 r40564  
    7676     */
    7777    public function test_admin_bar_contains_correct_links_for_users_with_no_role() {
    78         $this->skipWithMultisite();
    79 
    8078        $this->assertFalse( user_can( self::$no_role_id, 'read' ) );
    8179
     
    103101     */
    104102    public function test_admin_bar_contains_correct_links_for_users_with_role() {
    105         $this->skipWithMultisite();
    106 
    107103        $this->assertTrue( user_can( self::$editor_id, 'read' ) );
    108104
     
    133129     */
    134130    public function test_admin_bar_contains_correct_links_for_users_with_no_role_on_blog() {
    135         $this->skipWithoutMultisite();
    136 
    137131        $blog_id = self::factory()->blog->create( array(
    138132            'user_id' => self::$admin_id,
     
    182176     */
    183177    public function test_admin_bar_contains_correct_links_for_users_with_no_role_on_network() {
    184         $this->skipWithoutMultisite();
    185 
    186178        $this->assertTrue( user_can( self::$admin_id, 'read' ) );
    187179        $this->assertFalse( user_can( self::$no_role_id, 'read' ) );
     
    425417     */
    426418    public function test_admin_bar_contains_correct_about_link_for_users_with_role() {
    427         $this->skipWithMultisite();
    428 
    429419        wp_set_current_user( self::$editor_id );
    430420
     
    444434     */
    445435    public function test_admin_bar_contains_correct_about_link_for_users_with_no_role() {
    446         $this->skipWithMultisite();
    447 
    448436        wp_set_current_user( self::$no_role_id );
    449437
     
    465453     */
    466454    public function test_admin_bar_contains_correct_about_link_for_users_with_no_role_in_multisite() {
    467         $this->skipWithoutMultisite();
    468 
    469455        // User is not a member of a site.
    470456        remove_user_from_blog( self::$no_role_id, get_current_blog_id() );
     
    583569     */
    584570    public function test_my_sites_network_menu_for_regular_user() {
    585         $this->skipWithoutMultisite();
    586 
    587571        wp_set_current_user( self::$editor_id );
    588572
     
    600584     */
    601585    public function test_my_sites_network_menu_for_super_admin() {
    602         $this->skipWithoutMultisite();
    603 
    604586        wp_set_current_user( self::$editor_id );
    605587
     
    619601     */
    620602    public function test_my_sites_network_menu_for_regular_user_with_network_caps() {
    621         $this->skipWithoutMultisite();
    622 
    623603        global $current_user;
    624604
Note: See TracChangeset for help on using the changeset viewer.