mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
code coverage support for plugins
typo fix in testsuite shell git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6734 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
5ea06cb29c
commit
e38afee93d
5 changed files with 13 additions and 7 deletions
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 "<p><a href='" . RUN_TEST_LINK . $query . "'>Analyze Code Coverage</a></p>\n";
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue