diff --git a/tests/phpunit/test-admin.php b/tests/phpunit/test-admin.php index a154d8f..52437ab 100644 --- a/tests/phpunit/test-admin.php +++ b/tests/phpunit/test-admin.php @@ -3,8 +3,14 @@ * Class AdminTest * * @package WPALLSTARS\PluginStarterTemplate + * @group wpmock */ +// Skip this test file if WP_Mock is not available or WordPress test framework is loaded. +if ( ! class_exists( 'WP_Mock' ) || class_exists( 'WP_UnitTestCase' ) ) { + return; +} + use WPALLSTARS\PluginStarterTemplate\Admin\Admin; use WPALLSTARS\PluginStarterTemplate\Core; diff --git a/tests/phpunit/test-core.php b/tests/phpunit/test-core.php index fd83774..1cc9b36 100644 --- a/tests/phpunit/test-core.php +++ b/tests/phpunit/test-core.php @@ -3,8 +3,14 @@ * Class CoreTest * * @package WPALLSTARS\PluginStarterTemplate + * @group wpmock */ +// Skip this test file if WP_Mock is not available or WordPress test framework is loaded. +if ( ! class_exists( 'WP_Mock' ) || class_exists( 'WP_UnitTestCase' ) ) { + return; +} + use WPALLSTARS\PluginStarterTemplate\Core; /** diff --git a/tests/phpunit/test-multisite.php b/tests/phpunit/test-multisite.php index a9723f2..826609f 100644 --- a/tests/phpunit/test-multisite.php +++ b/tests/phpunit/test-multisite.php @@ -3,8 +3,14 @@ * Class MultisiteTest * * @package WP_Plugin_Starter_Template_For_AI_Coding + * @group wordpress */ +// Skip this test file if WordPress test framework is not available. +if ( ! class_exists( 'WP_UnitTestCase' ) ) { + return; +} + /** * Sample test case for the Multisite class. */