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

View File

@@ -75,8 +75,6 @@ class Tests_General_Template extends WP_UnitTestCase {
* @group ms-required
*/
function test_has_site_icon_returns_true_when_called_for_other_site_with_site_icon_set() {
$this->skipWithoutMultisite();
$blog_id = $this->factory->blog->create();
switch_to_blog( $blog_id );
$this->_set_site_icon();
@@ -91,8 +89,6 @@ class Tests_General_Template extends WP_UnitTestCase {
* @group ms-required
*/
function test_has_site_icon_returns_false_when_called_for_other_site_without_site_icon_set() {
$this->skipWithoutMultisite();
$blog_id = $this->factory->blog->create();
$this->assertFalse( has_site_icon( $blog_id ) );
@@ -265,8 +261,6 @@ class Tests_General_Template extends WP_UnitTestCase {
* @group ms-required
*/
function test_has_custom_logo_returns_true_when_called_for_other_site_with_custom_logo_set() {
$this->skipWithoutMultisite();
$blog_id = $this->factory->blog->create();
switch_to_blog( $blog_id );
$this->_set_custom_logo();
@@ -281,8 +275,6 @@ class Tests_General_Template extends WP_UnitTestCase {
* @group ms-required
*/
function test_has_custom_logo_returns_false_when_called_for_other_site_without_custom_logo_set() {
$this->skipWithoutMultisite();
$blog_id = $this->factory->blog->create();
$this->assertFalse( has_custom_logo( $blog_id ) );
@@ -311,8 +303,6 @@ class Tests_General_Template extends WP_UnitTestCase {
* @group ms-required
*/
function test_get_custom_logo_returns_logo_when_called_for_other_site_with_custom_logo_set() {
$this->skipWithoutMultisite();
$blog_id = $this->factory->blog->create();
switch_to_blog( $blog_id );
@@ -532,8 +522,6 @@ class Tests_General_Template extends WP_UnitTestCase {
* @group ms-required
*/
function test_get_site_icon_url_preserves_switched_state() {
$this->skipWithoutMultisite();
$blog_id = $this->factory->blog->create();
switch_to_blog( $blog_id );
@@ -553,8 +541,6 @@ class Tests_General_Template extends WP_UnitTestCase {
* @group ms-required
*/
function test_has_custom_logo_preserves_switched_state() {
$this->skipWithoutMultisite();
$blog_id = $this->factory->blog->create();
switch_to_blog( $blog_id );
@@ -574,8 +560,6 @@ class Tests_General_Template extends WP_UnitTestCase {
* @group ms-required
*/
function test_get_custom_logo_preserves_switched_state() {
$this->skipWithoutMultisite();
$blog_id = $this->factory->blog->create();
switch_to_blog( $blog_id );