| 1 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
// BC hack to define PATH_SEPARATOR for version of PHP prior 4.3
|
|
|
4 |
if (!defined('PATH_SEPARATOR')) {
|
|
|
5 |
if (defined('DIRECTORY_SEPARATOR') && DIRECTORY_SEPARATOR == "\\") {
|
|
|
6 |
define('PATH_SEPARATOR', ';');
|
|
|
7 |
} else {
|
|
|
8 |
define('PATH_SEPARATOR', ':');
|
|
|
9 |
}
|
|
|
10 |
}
|
|
|
11 |
ini_set('include_path', '..'.PATH_SEPARATOR.ini_get('include_path'));
|
|
|
12 |
|
|
|
13 |
require_once 'PHPUnit.php';
|
|
|
14 |
require_once 'test_setup.php';
|
|
|
15 |
require_once 'testUtils.php';
|
|
|
16 |
|
|
|
17 |
$output = '';
|
|
|
18 |
foreach ($testcases as $testcase) {
|
|
|
19 |
include_once $testcase.'.php';
|
|
|
20 |
$output.= '<fieldset>'."\n";
|
|
|
21 |
$output.= '<legend><input type="checkbox" id="selectAll_'.$testcase.'" onclick="return checkAll(\''.$testcase.'\');" /> <b>TestCase : '.$testcase.'</b></legend>'."\n";
|
|
|
22 |
$testmethods[$testcase] = getTests($testcase);
|
|
|
23 |
foreach ($testmethods[$testcase] as $method) {
|
|
|
24 |
$output.= testCheck($testcase, $method);
|
|
|
25 |
}
|
|
|
26 |
$output.= "</fieldset><br />\n\n";
|
|
|
27 |
$output.= "<input name=\"submit\" type=\"submit\"><br /> <br />\n\n";
|
|
|
28 |
}
|
|
|
29 |
|
|
|
30 |
?>
|
|
|
31 |
<html>
|
|
|
32 |
<head>
|
|
|
33 |
<title>MDB2 Tests</title>
|
|
|
34 |
<link href="tests.css" rel="stylesheet" type="text/css">
|
|
|
35 |
<script language="javascript" type="text/javascript">
|
|
|
36 |
<!--
|
|
|
37 |
function checkAll(testcase)
|
|
|
38 |
{
|
|
|
39 |
var boolValue = document.getElementById('selectAll_'+testcase).checked;
|
|
|
40 |
var substr_name = "testmethods[" + testcase + "]";
|
|
|
41 |
var substr_len = substr_name.length;
|
|
|
42 |
for (var i=0; i<document.getElementsByTagName('input').length; i++)
|
|
|
43 |
{
|
|
|
44 |
var e = document.getElementsByTagName('input').item(i);
|
|
|
45 |
if (e.getAttribute('type') == 'checkbox') {
|
|
|
46 |
if (e.name.substr(0, substr_len) == substr_name) {
|
|
|
47 |
e.checked = boolValue;
|
|
|
48 |
}
|
|
|
49 |
}
|
|
|
50 |
}
|
|
|
51 |
}
|
|
|
52 |
// -->
|
|
|
53 |
</script>
|
|
|
54 |
</head>
|
|
|
55 |
<body>
|
|
|
56 |
|
|
|
57 |
<form id="testchooseForm" name="testchooseForm" method="post" action="test.php">
|
|
|
58 |
<?php
|
|
|
59 |
echo($output);
|
|
|
60 |
?>
|
|
|
61 |
|
|
|
62 |
</form>
|
|
|
63 |
</body>
|
|
|
64 |
</html>
|