<?php
/**
 * This file contains the web interface to PhpMyObject Test Cases
 *
 * This file is part of the PhpMyObject project,
 * an Object-Relational Mapping (ORM) system.
 * 
 * For questions, help, comments, discussion, etc., please join our
 * forum at {@link http://www.developpez.net/forums/forumdisplay.php?f=770} 
 * or our mailing list at {@link http://groups.google.com/group/pmo-dev}.
 *
 * PhpMyProject is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see {@link http://www.gnu.org/licenses/}.
 *
 * @package			PhpMyObject
 * @subpackage 	PMO_Tests
 * @author			Nicolas Boiteux <nicolas_boiteux@yahoo.fr>
 * @author			Louis Lapointe <laplix@gmail.com>
 * @link				http://pmo.developpez.com/
 * @since			PhpMyObject v0.15
 * @version			$Revision$
 * @copyright		Copyright (c) 2007-2008 Nicolas Boiteux 
 * @copyright		Copyright (c) 2008 Louis Lapointe
 * @license			GPLv3 {@link http://www.gnu.org/licenses/gpl}
 * @filesource
 */ 

/**
 * requires your configuration file.
 * set path to your config file.
 */
require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'config.php');

/************************************
 * this is going to come later
 * 
if (isset($_POST) && isset($_POST['go'])) {
	$go = true;
	if (isset($_POST['level'])) {
		switch ($_POST['level']) {
			case 0:
			case 1:
			case 2:
				$level = $_POST['level'];
				break;
			default:
				$level = 0;
				break;
		}
	}
	else {
		$level = 0;
	}

	if (isset($_POST['tests'])) {
		$tests = $_POST['tests'];
		if (count($tests) > 0) {
			$testSuite = new TestSuite('PhpMyObject Tests');
			foreach ($tests as $test) {
				$testSuite->addTestFile('tests/'.$test.'.php');
			}
			$testSuite->run(new PMO_HTMLReporter($level));
			exit;
		}
	}
}
****************************/

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
	"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>PhpMyObject Test Suite</title>
<style type="text/css">
fieldset {
	width:40%;
}
.disabled {
	color: #ccc;
}
.new {
	font-weight: bold;
}
</style>
</head>
<body>
<h1>Suite de tests de PhpMyObject</h1>

<ul>
<li><a href="PMO_TestSuite.php">Exécuter toute la suite de tests de PhpMyObject Test</a></li>
</ul>

<h2>Individual Tests</h2>

<ul>
<li>Configuration and tools
	<ul>
	<li><a href="tests/PMO_MyConfig_Test.php">PMO_MyConfig</a></li>
	<li><a class="disabled" href="#<?php //tests/PMO_MyArray_Test.php?>">PMO_MyArray</a></li>
	<li><a href="tests/PMO_MyParser_Test.php">PMO_MyParser</a></li>
	</ul>
</li>
<li> The DBMS drivers
	<ul>
	<li><a href="tests/PMO_Dbms_Mysql_Test.php">PMO_Dbms_Mysql</a></li>
	<li><a class="disabled" href="#<?php //tests/PMO_Dbms_Mysqli_Test.php?>">PMO_Dbms_Mysqli</a></li>
	<li><a class="disabled" href="#<?php //tests/PMO_Dbms_Pgsql_Test.php?>">PMO_Dbms_Pgsql</a></li>
	<li><a href="tests/PMO_Dbms_Sqlite_Test.php">PMO_Dbms_Sqlite</a></li>
	<li><a href="tests/PMO_Dbms_Pdo_Test.php">PMO_Dbms_Pdo</a></li>
	</ul>
</li>
<li>PMO_MyDbms with the supported drivers
	<ul>
	<li><a href="tests/PMO_MyDbms_Test.php">PMO_MyDbms testing all drivers</a></li>
	<li><a href="tests/PMO_MyDbms_Mysql_Test.php">PMO_MyDbms with the MySQL driver</a></li>
	<li><a class="disabled" href="#<?php //tests/PMO_MyDbms_Mysqli_Test.php?>">PMO_MyDbms with the MySQLi driver</a></li>
	<li><a class="disabled" href="#<?php //tests/PMO_MyDbms_Pgsql_Test.php?>">PMO_MyDbms with the PosgreSQL driver</a></li>
	<li><a class="disabled" href="#<?php //tests/PMO_MyDbms_Pdo_Mysql_Test.php?>">PMO_MyDbms with the Pdo MySQL driver</a></li>
	<li><a href="tests/PMO_MyDbms_Sqlite_Test.php">PMO_MyDbms with the Pdo Sqlite driver</a></li>
	</ul>
<li>Controller and objects
	<ul>
	<li><a href="tests/PMO_MyController_Test.php">PMO_MyController</a></li>
	<li><a href="tests/PMO_MyRequest_Test.php">PMO_MyRequest</a></li>
	<li><a href="tests/PMO_MyObject_Test.php">PMO_MyObject</a></li>
	<li><a class="disabled" href="#<?php //tests/PMO_MyTable_Test.php?>">PMO_MyTable</a></li>
	<li><a class="disabled" href="#<?php //tests/PMO_MyMap_Test.php?>">PMO_MyMap</a></li>
	</ul>
</li>

</ul>



<?php /***********************************

Refaire ça plus tard et l'intégrer à PMO_HTMLReporter

<form method="POST" action="<?php echo $_SERVER['REQUEST_URI'];?>">
<input name="go" type="hidden" value="1">
<fieldset id="testlevel">
	<legend>Detail Level</legend>
	<input name="level" type="radio" value="0">Show only global results
	<input name="level" type="radio" value="1">Show test cases results
	<input name="level" type="radio" value="2">Show all tests
</fieldset>
<fieldset id="dbms">
	<legend>PMO_MyDbms and DBMS drivers</legend>
	<div><input name="tests" type="checkbox" value="PMO_Dbms_Mysql_Test">PMO_Dbms_Mysql</div>
	<div class="disabled"><input name="tests" type="checkbox" value="PMO_Dbms_Mysqli_Test" disabled="disabled">PMO_Dbms_Mysqli</div>
	<div class="disabled"><input name="tests" type="checkbox" value="PMO_Dbms_Pgsql_Test" disabled="disabled">PMO_Dbms_PgSql</div>
	<div><input name="tests[]" type="checkbox" value="PMO_Dbms_Sqlite_Test">PMO_Dbms_Sqlite</div>
	<div><input name="tests[]" type="checkbox" value="PMO_Dbms_Pdo_Test">PMO_Dbms_Pdo</div>
	<div><input name="tests[]" type="checkbox" value="PMO_MyDbms_Test">PMO_MyDbms</div>
</fieldset>
<fieldset id="misc">
	<legend>Miscellaneous</legend>
	<div><input name="tests[]" type="checkbox" value="PMO_Myconfig_Test">PMO_MyConfig Test</div>
</fieldset>
<div id="go">
	<input type="submit" value="Start the tests">
</div>
</form>
 *****************************/
?>

</body>
</html>
