diff --git a/tests/phpunit/tests/option/siteTransient.php b/tests/phpunit/tests/option/siteTransient.php index 621b2c1b31..ef7acc34f0 100644 --- a/tests/phpunit/tests/option/siteTransient.php +++ b/tests/phpunit/tests/option/siteTransient.php @@ -5,6 +5,14 @@ */ class Tests_Option_SiteTransient extends WP_UnitTestCase { + public function setUp() { + parent::setUp(); + + if ( wp_using_ext_object_cache() ) { + $this->markTestSkipped( 'Not testable with an external object cache.' ); + } + } + function test_the_basics() { $key = rand_str(); $value = rand_str(); diff --git a/tests/phpunit/tests/option/transient.php b/tests/phpunit/tests/option/transient.php index 3dbd79d6d6..06833b6830 100644 --- a/tests/phpunit/tests/option/transient.php +++ b/tests/phpunit/tests/option/transient.php @@ -5,6 +5,14 @@ */ class Tests_Option_Transient extends WP_UnitTestCase { + public function setUp() { + parent::setUp(); + + if ( wp_using_ext_object_cache() ) { + $this->markTestSkipped( 'Not testable with an external object cache.' ); + } + } + function test_the_basics() { $key = rand_str(); $value = rand_str(); @@ -42,10 +50,6 @@ class Tests_Option_Transient extends WP_UnitTestCase { $this->markTestSkipped( 'Not testable in MS: wpmu_create_blog() defines WP_INSTALLING.' ); } - if ( wp_using_ext_object_cache() ) { - $this->markTestSkipped( 'Not testable with an external object cache.' ); - } - $key = rand_str(); $value = rand_str(); @@ -71,10 +75,6 @@ class Tests_Option_Transient extends WP_UnitTestCase { $this->markTestSkipped( 'Not testable in MS: wpmu_create_blog() defines WP_INSTALLING.' ); } - if ( wp_using_ext_object_cache() ) { - $this->markTestSkipped( 'Not testable with an external object cache.' ); - } - $key = rand_str(); $value = rand_str(); $value2 = rand_str(); @@ -98,10 +98,6 @@ class Tests_Option_Transient extends WP_UnitTestCase { * @ticket 30380 */ function test_nonexistent_key_dont_delete_if_false() { - if ( wp_using_ext_object_cache() ) { - $this->markTestSkipped( 'Not testable with an external object cache.' ); - } - // Create a bogus a transient $key = 'test_transient'; set_transient( $key, 'test', 60 * 10 ); @@ -134,10 +130,6 @@ class Tests_Option_Transient extends WP_UnitTestCase { $this->markTestSkipped( 'Not testable in MS: wpmu_create_blog() defines WP_INSTALLING.' ); } - if ( wp_using_ext_object_cache() ) { - $this->markTestSkipped( 'Not testable with an external object cache.' ); - } - // Create a transient $key = 'test_transient'; set_transient( $key, 'test', 60 * 10 );