From 1fdc76ba1a4f5d83133529c0271b32beeb8bdd12 Mon Sep 17 00:00:00 2001 From: DarkAngelBGE Date: Wed, 30 Jul 2008 13:39:17 +0000 Subject: [PATCH] enabling different paths for plugin tests closes #5105 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7378 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/tests/lib/cake_test_case.php | 7 +++++++ cake/tests/lib/code_coverage_manager.php | 25 ++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index 2d2f886ec..30b74e2f4 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -694,6 +694,13 @@ class CakeTestCase extends UnitTestCase { TESTS . 'fixtures', VENDORS . 'tests' . DS . 'fixtures' ); + $pluginPaths = Configure::read('pluginPaths'); + foreach ($pluginPaths as $path) { + if (file_exists($path . $pluginName . DS . 'tests' . DS. 'fixtures')) { + $fixturePaths[0] = $path . $pluginName . DS . 'tests' . DS. 'fixtures'; + break; + } + } } else { $fixturePaths = array( TESTS . 'fixtures', diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index 35a3ed457..3e9493fe0 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -515,6 +515,15 @@ class CodeCoverageManager { if (!!$manager->pluginTest) { $path = APP . 'plugins' . DS . $manager->pluginTest . DS . 'tests' . DS . 'groups'; + + $pluginPaths = Configure::read('pluginPaths'); + foreach ($pluginPaths as $pluginPath) { + $tmpPath = $pluginPath . $manager->pluginTest . DS . 'tests' . DS. 'groups'; + if (file_exists($tmpPath)) { + $path = $tmpPath; + break; + } + } } $path .= DS . $groupFile . $testManager->_groupExtension; @@ -707,10 +716,22 @@ class CodeCoverageManager { if ($isApp) { $path .= APP_DIR . DS; } elseif (!!$manager->pluginTest) { - $path .= APP_DIR . DS . 'plugins' . DS . $manager->pluginTest . DS; + $pluginPath = APP . 'plugins' . DS . $manager->pluginTest . DS; + + $pluginPaths = Configure::read('pluginPaths'); + foreach ($pluginPaths as $tmpPath) { + $tmpPath = $tmpPath . $manager->pluginTest . DS; + if (file_exists($tmpPath)) { + $pluginPath = $tmpPath; + break; + } + } + + $path = $pluginPath; } else { $path = TEST_CAKE_CORE_INCLUDE_PATH; } + return $path; } /** @@ -738,4 +759,4 @@ class CodeCoverageManager { return false; } } -?> +?> \ No newline at end of file