mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Altering test.php to use CakeTestMenu instead of global functions.
This commit is contained in:
parent
397bdaf3e1
commit
034d016a4f
1 changed files with 14 additions and 13 deletions
|
@ -86,6 +86,7 @@ if (isset($corePath[0])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once CAKE_TESTS_LIB . 'test_manager.php';
|
require_once CAKE_TESTS_LIB . 'test_manager.php';
|
||||||
|
require_once CAKE_TESTS_LIB . 'cake_test_menu.php';
|
||||||
|
|
||||||
if (Configure::read('debug') < 1) {
|
if (Configure::read('debug') < 1) {
|
||||||
die(__('Debug setting does not allow access to this url.', true));
|
die(__('Debug setting does not allow access to this url.', true));
|
||||||
|
@ -112,9 +113,9 @@ if (isset($_GET['output']) && $_GET['output'] == 'html') {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!App::import('Vendor', 'simpletest' . DS . 'reporter')) {
|
if (!App::import('Vendor', 'simpletest' . DS . 'reporter')) {
|
||||||
CakePHPTestHeader();
|
CakeTestMenu::testHeader();
|
||||||
include CAKE_TESTS_LIB . 'simpletest.php';
|
include CAKE_TESTS_LIB . 'simpletest.php';
|
||||||
CakePHPTestSuiteFooter();
|
CakeTestMenu::footer();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,15 +124,15 @@ if (isset($_GET['code_coverage'])) {
|
||||||
$analyzeCodeCoverage = true;
|
$analyzeCodeCoverage = true;
|
||||||
require_once CAKE_TESTS_LIB . 'code_coverage_manager.php';
|
require_once CAKE_TESTS_LIB . 'code_coverage_manager.php';
|
||||||
if (!extension_loaded('xdebug')) {
|
if (!extension_loaded('xdebug')) {
|
||||||
CakePHPTestHeader();
|
CakeTestMenu::testHeader();
|
||||||
include CAKE_TESTS_LIB . 'xdebug.php';
|
include CAKE_TESTS_LIB . 'xdebug.php';
|
||||||
CakePHPTestSuiteFooter();
|
CakeTestMenu::footer();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CakePHPTestHeader();
|
CakeTestMenu::testHeader();
|
||||||
CakePHPTestSuiteHeader();
|
CakeTestMenu::testSuiteHeader();
|
||||||
define('RUN_TEST_LINK', $_SERVER['PHP_SELF']);
|
define('RUN_TEST_LINK', $_SERVER['PHP_SELF']);
|
||||||
|
|
||||||
if (isset($_GET['group'])) {
|
if (isset($_GET['group'])) {
|
||||||
|
@ -147,8 +148,8 @@ if (isset($_GET['group'])) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CakePHPTestRunMore();
|
CakeTestMenu::runMore();
|
||||||
CakePHPTestAnalyzeCodeCoverage();
|
CakeTestMenu::analyzeCodeCoverage();
|
||||||
} elseif (isset($_GET['case'])) {
|
} elseif (isset($_GET['case'])) {
|
||||||
if ($analyzeCodeCoverage) {
|
if ($analyzeCodeCoverage) {
|
||||||
CodeCoverageManager::start($_GET['case'], CakeTestsGetReporter());
|
CodeCoverageManager::start($_GET['case'], CakeTestsGetReporter());
|
||||||
|
@ -160,14 +161,14 @@ if (isset($_GET['group'])) {
|
||||||
CodeCoverageManager::report();
|
CodeCoverageManager::report();
|
||||||
}
|
}
|
||||||
|
|
||||||
CakePHPTestRunMore();
|
CakeTestMenu::runMore();
|
||||||
CakePHPTestAnalyzeCodeCoverage();
|
CakeTestMenu::analyzeCodeCoverage();
|
||||||
} elseif (isset($_GET['show']) && $_GET['show'] == 'cases') {
|
} elseif (isset($_GET['show']) && $_GET['show'] == 'cases') {
|
||||||
CakePHPTestCaseList();
|
CakeTestMenu::testCaseList();
|
||||||
} else {
|
} else {
|
||||||
CakePHPTestGroupTestList();
|
CakeTestMenu::groupTestList();
|
||||||
}
|
}
|
||||||
CakePHPTestSuiteFooter();
|
CakeTestMenu::footer();
|
||||||
$output = ob_get_clean();
|
$output = ob_get_clean();
|
||||||
echo $output;
|
echo $output;
|
||||||
?>
|
?>
|
Loading…
Reference in a new issue