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


git-svn-id: https://develop.svn.wordpress.org/trunk@40520 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn
2017-04-22 18:58:46 +00:00
parent c717bfbba9
commit 4f8057f7d5
20 changed files with 131 additions and 8 deletions

View File

@@ -72,6 +72,7 @@ class Tests_AdminBar extends WP_UnitTestCase {
/**
* @ticket 25162
* @group ms-excluded
*/
public function test_admin_bar_contains_correct_links_for_users_with_no_role() {
if ( is_multisite() ) {
@@ -100,6 +101,7 @@ class Tests_AdminBar extends WP_UnitTestCase {
/**
* @ticket 25162
* @group ms-excluded
*/
public function test_admin_bar_contains_correct_links_for_users_with_role() {
if ( is_multisite() ) {
@@ -131,6 +133,7 @@ class Tests_AdminBar extends WP_UnitTestCase {
/**
* @ticket 25162
* @group multisite
* @group ms-required
*/
public function test_admin_bar_contains_correct_links_for_users_with_no_role_on_blog() {
if ( ! is_multisite() ) {
@@ -181,6 +184,7 @@ class Tests_AdminBar extends WP_UnitTestCase {
/**
* @ticket 25162
* @group multisite
* @group ms-required
*/
public function test_admin_bar_contains_correct_links_for_users_with_no_role_on_network() {
if ( ! is_multisite() ) {
@@ -425,6 +429,7 @@ class Tests_AdminBar extends WP_UnitTestCase {
/**
* @ticket 37949
* @group ms-excluded
*/
public function test_admin_bar_contains_correct_about_link_for_users_with_role() {
if ( is_multisite() ) {
@@ -445,6 +450,7 @@ class Tests_AdminBar extends WP_UnitTestCase {
/**
* @ticket 37949
* @group ms-excluded
*/
public function test_admin_bar_contains_correct_about_link_for_users_with_no_role() {
if ( is_multisite() ) {
@@ -467,6 +473,7 @@ class Tests_AdminBar extends WP_UnitTestCase {
/**
* @ticket 37949
* @group multisite
* @group ms-required
*/
public function test_admin_bar_contains_correct_about_link_for_users_with_no_role_in_multisite() {
if ( ! is_multisite() ) {
@@ -586,6 +593,7 @@ class Tests_AdminBar extends WP_UnitTestCase {
/**
* @ticket 39082
* @group ms-required
*/
public function test_my_sites_network_menu_for_regular_user() {
if ( ! is_multisite() ) {
@@ -604,6 +612,7 @@ class Tests_AdminBar extends WP_UnitTestCase {
/**
* @ticket 39082
* @group ms-required
*/
public function test_my_sites_network_menu_for_super_admin() {
if ( ! is_multisite() ) {
@@ -624,6 +633,7 @@ class Tests_AdminBar extends WP_UnitTestCase {
/**
* @ticket 39082
* @group ms-required
*/
public function test_my_sites_network_menu_for_regular_user_with_network_caps() {
global $current_user;