diff options
-rw-r--r-- | index.php | 2 | ||||
-rw-r--r-- | modules/unit_test/libraries/Unit_Test.php | 4 |
2 files changed, 5 insertions, 1 deletions
@@ -47,7 +47,7 @@ define('SYSPATH', strtr(realpath('kohana') . '/', DIRECTORY_SEPARATOR, '/')); // Force a test run if we're in command line mode. if (PHP_SAPI == 'cli') { - $_SERVER['argv'] = array($_SERVER['argv'][0], 'gallery_unit_test'); + array_splice($_SERVER['argv'], 1, 0, 'gallery_unit_test'); define('TEST_MODE', 1); @system('mkdir -p test/var/logs'); define('VARPATH', strtr(realpath('test/var') . '/', DIRECTORY_SEPARATOR, '/')); 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; |