merging from my sandbox

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@795 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2005-09-11 04:51:40 +00:00
parent 731cc517e9
commit f6662921c2
3 changed files with 58 additions and 19 deletions

View file

@ -50,23 +50,18 @@ class TestsController extends TestsHelper {
function groups ()
{
$this->layout = null;
$_GET['show'] = 'groups';
require_once TESTS.'index.php';
exit();
}
function cases ()
{
$this->layout = null;
$_GET['show'] = 'cases';
require_once TESTS.'index.php';
exit();
}
/**
* Runs all library and application tests
*
*/
// function test_all ()
// {
// $this->layout = null;
// require_once SCRIPTS.'test.php';
// }
}
?>

View file

@ -119,7 +119,11 @@ define('CAKE_TEST_OUTPUT_TEXT',3);
case CAKE_TEST_OUTPUT_XML:
break;
case CAKE_TEST_OUTPUT_HTML:
echo "<p><a href='" . $_SERVER['PHP_SELF'] . "'>Run more tests</a></p>";
$link = class_exists('Object')
? "<p><a href='/tests/'>Run more tests</a></p>\n"
:
"<p><a href='" . $_SERVER['PHP_SELF'] . "'>Run more tests</a></p>\n";
echo $link;
break;
case CAKE_TEST_OUTPUT_TEXT:

View file

@ -91,7 +91,17 @@ class TestManager
}
$testCases =& $manager->_getTestFileList($testCasePath);
$test =& new GroupTest('All Tests');
$test =& new GroupTest('All Core Tests');
if (isset($_GET['app']))
{
$test =& new GroupTest('All App Tests');
}
else
{
$test =& new GroupTest('All Core Tests');
}
foreach ($testCases as $testCase)
{
@ -391,12 +401,29 @@ class HtmlTestManager extends TestManager {
return "<p>No test groups set up!</p>";
}
$buffer = "<p>Available test groups:</p>\n<ul>";
$buffer .= "<li><a href='" . $manager->getBaseURL() . "?group=all$userApp'>All tests</a></li>\n";
if (isset($_GET['app']))
{
$buffer = "<p>Available App Test Groups:</p>\n<ul>";
}
else
{
$buffer = "<p>Available Core Test Groups:</p>\n<ul>";
}
$buffer .= class_exists('Object')
? "<li><a href='/tests/?group=all$userApp'>All tests</a></li>\n"
:
"<li><a href='" . $manager->getBaseURL() . "?group=all$userApp'>All tests</a></li>\n";
foreach ($groupTests as $groupTest)
{
$buffer .= "<li><a href='" . $manager->getBaseURL() . "?group={$groupTest}'>" .
$groupTest . $userApp ."</a></li>\n";
$buffer .= class_exists('Object')
? "<li><a href='/tests/groups/?group={$groupTest}" . "{$userApp}'>" .
$groupTest . "</a></li>\n"
:
"<li><a href='" . $manager->getBaseURL() . "?group={$groupTest}" . "{$userApp}'>" .
$groupTest . "</a></li>\n";
}
return $buffer . "</ul>\n";
}
@ -414,12 +441,25 @@ class HtmlTestManager extends TestManager {
if (1 > count($testCases)) {
return "<p>No test cases set up!</p>";
}
$buffer = "<p>Available test cases:</p>\n<ul>";
if (isset($_GET['app']))
{
$buffer = "<p>Available App Test Cases:</p>\n<ul>";
}
else
{
$buffer = "<p>Available Core Test Cases:</p>\n<ul>";
}
foreach ($testCases as $testCaseFile => $testCase)
{
$buffer .= "<li><a href='" . $manager->getBaseURL() .
"?case=" . urlencode($testCase) . $userApp ."'>" .
$testCase . "</a></li>\n";
$buffer .= class_exists('Object')
? "<li><a href='cases?case=" . urlencode($testCase) . $userApp ."'>" .
$testCase . "</a></li>\n"
:
"<li><a href='" . $manager->getBaseURL() .
"?case=" . urlencode($testCase) . $userApp ."'>" .
$testCase . "</a></li>\n";
}
return $buffer . "</ul>\n";
}