mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-09-25 10:20:22 +00:00
Build/Test Tools: Introduce skipWithoutMultisite() and skipWithMultisite() methods into the test suite.
This brings much needed uniformity to test skipping when a test requires Multisite or when a test should be excluded from running when Multisite is enabled. Used in conjunction with the `@group ms-required` and `@group ms-excluded` notation, this removes a significant number of skipped tests from the default test suite run. Fixes #40531 git-svn-id: https://develop.svn.wordpress.org/trunk@40543 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -197,6 +197,28 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow tests to be skipped when Multisite is not in use.
|
||||
*
|
||||
* Use in conjunction with the ms-required group.
|
||||
*/
|
||||
public function skipWithoutMultisite() {
|
||||
if ( ! is_multisite() ) {
|
||||
$this->markTestSkipped( 'Test only runs on Multisite' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow tests to be skipped when Multisite is in use.
|
||||
*
|
||||
* Use in conjunction with the ms-excluded group.
|
||||
*/
|
||||
public function skipWithMultisite() {
|
||||
if ( is_multisite() ) {
|
||||
$this->markTestSkipped( 'Test does not run on Multisite' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregister existing post types and register defaults.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user