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


git-svn-id: https://develop.svn.wordpress.org/trunk@40564 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn
2017-05-01 20:34:10 +00:00
parent f72ce6dc6e
commit c759785cea
20 changed files with 11 additions and 152 deletions
@@ -16,8 +16,6 @@ class Tests_Option_NetworkOption extends WP_UnitTestCase {
* @group ms-required
*/
function test_add_network_option_not_available_on_other_network() {
$this->skipWithoutMultisite();
$id = self::factory()->network->create();
$option = __FUNCTION__;
$value = __FUNCTION__;
@@ -30,8 +28,6 @@ class Tests_Option_NetworkOption extends WP_UnitTestCase {
* @group ms-required
*/
function test_add_network_option_available_on_same_network() {
$this->skipWithoutMultisite();
$id = self::factory()->network->create();
$option = __FUNCTION__;
$value = __FUNCTION__;
@@ -44,8 +40,6 @@ class Tests_Option_NetworkOption extends WP_UnitTestCase {
* @group ms-required
*/
function test_delete_network_option_on_only_one_network() {
$this->skipWithoutMultisite();
$id = self::factory()->network->create();
$option = __FUNCTION__;
$value = __FUNCTION__;
@@ -61,8 +55,6 @@ class Tests_Option_NetworkOption extends WP_UnitTestCase {
* @group ms-excluded
*/
public function test_add_network_option_is_not_stored_as_autoload_option() {
$this->skipWithMultisite();
$key = __FUNCTION__;
add_network_option( null, $key, 'Not an autoload option' );
@@ -77,8 +69,6 @@ class Tests_Option_NetworkOption extends WP_UnitTestCase {
* @group ms-excluded
*/
public function test_update_network_option_is_not_stored_as_autoload_option() {
$this->skipWithMultisite();
$key = __FUNCTION__;
update_network_option( null, $key, 'Not an autoload option' );
@@ -47,8 +47,6 @@ class Tests_Option_SiteTransient extends WP_UnitTestCase {
* @group ms-excluded
*/
public function test_set_site_transient_is_not_stored_as_autoload_option() {
$this->skipWithMultisite();
$key = 'not_autoloaded';
set_site_transient( $key, 'Not an autoload option' );