From 08f9822b72932bafa4aa6327f601e1901e2e0003 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 1 Nov 2008 09:02:24 +0000 Subject: Exclude demo tests --- modules/gallery_unit_test/controllers/test.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'modules/gallery_unit_test/controllers/test.php') diff --git a/modules/gallery_unit_test/controllers/test.php b/modules/gallery_unit_test/controllers/test.php index de3a3410..d7a9de90 100644 --- a/modules/gallery_unit_test/controllers/test.php +++ b/modules/gallery_unit_test/controllers/test.php @@ -22,6 +22,17 @@ class Test_Controller extends Controller { if (!defined('TEST_MODE')) { print Kohana::show_404(); } + + // Find all tests, excluding sample tests that come with the unit_test module. + $paths = array(APPPATH . "tests"); + foreach (glob(MODPATH . "*/tests") as $path) { + if ($path != MODPATH . "unit_test/tests") { + $paths[] = $path; + } + + } + Kohana::config_set('unit_test.paths', $paths); + $test = new Unit_Test(DOCROOT . "modules/gallery_unit_test/tests"); echo $test; } -- cgit v1.2.3