From 83d80f7329fe79868efa0341cc9d99e4bbee83e8 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Sat, 16 Apr 2016 19:21:49 +0000 Subject: [PATCH] Tests: Run network option tests as single and multisite The `_network_option()` functions are available to all and internally use `_option()` functions as a fallback. We should be testing for that scenario as well. Fixes #36552. git-svn-id: https://develop.svn.wordpress.org/trunk@37222 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/option/networkOption.php | 21 +++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/tests/option/networkOption.php b/tests/phpunit/tests/option/networkOption.php index 1e0bd71b97..4ac33b820d 100644 --- a/tests/phpunit/tests/option/networkOption.php +++ b/tests/phpunit/tests/option/networkOption.php @@ -1,9 +1,10 @@ markTestSkipped( 'Test requires multisite' ); + } + $id = self::factory()->network->create(); $option = rand_str(); $value = rand_str(); @@ -20,6 +25,10 @@ class Tests_Option_NetworkOption extends WP_UnitTestCase { } function test_add_network_option_available_on_same_network() { + if ( ! is_multisite() ) { + $this->markTestSkipped( 'Test requires multisite' ); + } + $id = self::factory()->network->create(); $option = rand_str(); $value = rand_str(); @@ -29,6 +38,10 @@ class Tests_Option_NetworkOption extends WP_UnitTestCase { } function test_delete_network_option_on_only_one_network() { + if ( ! is_multisite() ) { + $this->markTestSkipped( 'Test requires multisite' ); + } + $id = self::factory()->network->create(); $option = rand_str(); $value = rand_str(); @@ -83,5 +96,3 @@ class Tests_Option_NetworkOption extends WP_UnitTestCase { ); } } - -endif; \ No newline at end of file