diff --git a/app/webroot/test.php b/app/webroot/test.php index 68c4e8093..66c8d5a75 100644 --- a/app/webroot/test.php +++ b/app/webroot/test.php @@ -69,6 +69,7 @@ if (isset($corePath[0])) { } else { define('TEST_CAKE_CORE_INCLUDE_PATH', CAKE_CORE_INCLUDE_PATH); } + require_once CAKE_TESTS_LIB . 'test_manager.php'; if (Configure::read('debug') < 1) { diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php index 76a45cb60..ca71ef89f 100644 --- a/cake/console/libs/testsuite.php +++ b/cake/console/libs/testsuite.php @@ -282,7 +282,7 @@ class TestSuiteShell extends Shell { */ function __installSimpleTest() { if (!App::import('Vendor', 'simpletest' . DS . 'reporter')) { - $this->err('Sorry,. Simpletest could not be found. Download it from http://simpletest.org and install it to your vendors directory.'); + $this->err('Sorry, Simpletest could not be found. Download it from http://simpletest.org and install it to your vendors directory.'); exit; } } diff --git a/cake/tests/cases/libs/code_coverage_manager.test.php b/cake/tests/cases/libs/code_coverage_manager.test.php index da38c4bc3..fcfb69fff 100644 --- a/cake/tests/cases/libs/code_coverage_manager.test.php +++ b/cake/tests/cases/libs/code_coverage_manager.test.php @@ -84,6 +84,10 @@ class CodeCoverageManagerTest extends UnitTestCase { $expected = $manager->__testObjectFileFromCaseFile('helpers/some_file.test.php', true); $this->assertIdentical(APP.'views'.DS.'helpers'.DS.'some_file.php', $expected); + + $manager->pluginTest = 'bugs'; + $expected = $manager->__testObjectFileFromCaseFile('models/some_file.test.php', false); + $this->assertIdentical(APP.'plugins'.DS.'bugs'.DS.'models'.DS.'some_file.php', $expected); } function testOfHtmlReport() { diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index 1135c4575..fbf1067f6 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -99,7 +99,7 @@ class CodeCoverageManager { } if (isset($_GET['plugin'])) { - $manager->pluginTest = true; + $manager->pluginTest = $_GET['plugin']; } $manager->testCaseFile = $testCaseFile; @@ -312,9 +312,13 @@ class CodeCoverageManager { * @access private */ function __testObjectFileFromCaseFile($file, $isApp = true) { + $manager = CodeCoverageManager::getInstance(); + $path = ROOT.DS; if ($isApp) { $path .= APP_DIR.DS; + } elseif (!!$manager->pluginTest) { + $path .= APP_DIR.DS.'plugins'.DS.$manager->pluginTest.DS; } else { $path .= CAKE; } diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index 1056d7d48..a63d98723 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -455,13 +455,10 @@ if (function_exists('caketestsgetreporter')) { $query = '?case='.$_GET['case']; if (isset($_GET['app'])) { $query .= '&app=true'; + } elseif (isset($_GET['plugin'])) { + $query .= '&plugin=' . $_GET['plugin']; } $query .= '&code_coverage=true'; - // else if (isset($_GET['plugin'])) { - // $show = '?show=cases&plugin=' . $_GET['plugin']; - // } else { - // $show = '?show=cases'; - // } echo "

Analyze Code Coverage

\n"; } break;