From 53664787d459066eaf26a3dec1df7c25eddcc912 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 3 Dec 2008 06:00:30 +0000 Subject: Add a filter to unit tests. Now you can do 'php index.php Album_Helper_Test Photo_Helper_Test' to just run those two --- modules/unit_test/libraries/Unit_Test.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/unit_test') diff --git a/modules/unit_test/libraries/Unit_Test.php b/modules/unit_test/libraries/Unit_Test.php index 4e22f501..43fa2152 100644 --- a/modules/unit_test/libraries/Unit_Test.php +++ b/modules/unit_test/libraries/Unit_Test.php @@ -64,6 +64,10 @@ class Unit_Test_Core { // The class name should be the same as the file name $class = substr($path, strrpos($path, '/') + 1, -(strlen(EXT))); + if (count($_SERVER['argv']) > 2 && !in_array($class, $_SERVER['argv'])) { + continue; + } + // Skip hidden files if (substr($class, 0, 1) === '.') continue; -- cgit v1.2.3