PhpMyObject
[ class tree: PhpMyObject ] [ index: PhpMyObject ] [ all elements ]

Source for file index.php

Documentation is available at index.php

  1. <?php
  2. /**
  3.  * This file contains the web interface to PhpMyObject Test Cases
  4.  *
  5.  * This file is part of the PhpMyObject project,
  6.  * an Object-Relational Mapping (ORM) system.
  7.  * 
  8.  * For questions, help, comments, discussion, etc., please join our
  9.  * forum at {@link http://www.developpez.net/forums/forumdisplay.php?f=770}
  10.  * or our mailing list at {@link http://groups.google.com/group/pmo-dev}.
  11.  *
  12.  * PhpMyProject is free software: you can redistribute it and/or modify
  13.  * it under the terms of the GNU General Public License as published by
  14.  * the Free Software Foundation, either version 3 of the License, or
  15.  * (at your option) any later version.
  16.  *
  17.  * This program is distributed in the hope that it will be useful,
  18.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.    See the
  20.  * GNU General Public License for more details.
  21.  *
  22.  * You should have received a copy of the GNU General Public License
  23.  * along with this program.  If not, see {@link http://www.gnu.org/licenses/}.
  24.  *
  25.  * @package            PhpMyObject
  26.  * @subpackage     PMO_Tests
  27.  * @author            Nicolas Boiteux <nicolas_boiteux@yahoo.fr>
  28.  * @author            Louis Lapointe <laplix@gmail.com>
  29.  * @link                http://pmo.developpez.com/
  30.  * @since            PhpMyObject v0.15
  31.  * @version            $Revision: 406 $
  32.  * @copyright        Copyright (c) 2007-2008 Nicolas Boiteux
  33.  * @copyright        Copyright (c) 2008 Louis Lapointe
  34.  * @license            GPLv3 {@link http://www.gnu.org/licenses/gpl}
  35.  * @filesource
  36.  */ 
  37.  
  38. /**
  39.  * requires your configuration file.
  40.  * set path to your config file.
  41.  */
  42. require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'config.php');
  43.  
  44. /************************************
  45.  * this is going to come later
  46.  * 
  47. if (isset($_POST) && isset($_POST['go'])) {
  48.     $go = true;
  49.     if (isset($_POST['level'])) {
  50.         switch ($_POST['level']) {
  51.             case 0:
  52.             case 1:
  53.             case 2:
  54.                 $level = $_POST['level'];
  55.                 break;
  56.             default:
  57.                 $level = 0;
  58.                 break;
  59.         }
  60.     }
  61.     else {
  62.         $level = 0;
  63.     }
  64.  
  65.     if (isset($_POST['tests'])) {
  66.         $tests = $_POST['tests'];
  67.         if (count($tests) > 0) {
  68.             $testSuite = new TestSuite('PhpMyObject Tests');
  69.             foreach ($tests as $test) {
  70.                 $testSuite->addTestFile('tests/'.$test.'.php');
  71.             }
  72.             $testSuite->run(new PMO_HTMLReporter($level));
  73.             exit;
  74.         }
  75.     }
  76. }
  77. ****************************/
  78.  
  79. ?>
  80. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  81.     "http://www.w3.org/TR/html4/strict.dtd">
  82. <html>
  83. <head>
  84. <title>PhpMyObject Test Suite</title>
  85. <style type="text/css">
  86. fieldset {
  87.     width:40%;
  88. }
  89. .disabled {
  90.     color: #ccc;
  91. }
  92. .new {
  93.     font-weight: bold;
  94. }
  95. </style>
  96. </head>
  97. <body>
  98. <h1>PhpMyObject Test Suite</h1>
  99.  
  100. <a href="PMO_TestSuite.php">Run the full PhpMyObjet Test Suite</a>
  101.  
  102. <h2>Individual Tests</h2>
  103.  
  104. <ul>
  105. <li>Configuration and tools
  106.     <ul>
  107.     <li><a href="tests/PMO_MyConfig_Test.php">PMO_MyConfig</a></li>
  108.     <li><a class="disabled" href="tests/PMO_MyArray_Test.php">PMO_MyArray</a> Not done yet</li>
  109.     <li><a class="disabled" href="tests/PMO_MyParser_Test.php">PMO_MyParser</a> Not done yet</li>
  110.     <li><a href="tests/PMO_MyRequest_Test.php">PMO_MyRequest</a></li>
  111.     </ul>
  112. </li>
  113. <li> the Dbms drivers
  114.     <ul>
  115.     <li><a href="tests/PMO_Dbms_Mysql_Test.php">PMO_Dbms_Mysql</a></li>
  116.     <li><a class="disabled" href="tests/PMO_Dbms_Mysqli_Test.php">PMO_Dbms_Mysqli</a></li>
  117.     <li><a class="disabled" href="tests/PMO_Dbms_Pgsql_Test.php">PMO_Dbms_Pgsql</a></li>
  118.     <li><a href="tests/PMO_Dbms_Sqlite_Test.php">PMO_Dbms_Sqlite</a></li>
  119.     <li><a href="tests/PMO_Dbms_Pdo_Test.php">PMO_Dbms_Pdo</a></li>
  120.     </ul>
  121. </li>
  122. <li>PMO_MyDbms with the supported drivers
  123.     <ul>
  124.     <li><a class="disabled" href="tests/PMO_MyDbms_Mysql_Test.php">PMO_MyDbms with the MySQL driver</a></li>
  125.     <li><a class="disabled" href="tests/PMO_MyDbms_Mysqli_Test.php">PMO_MyDbms with the MySQLi driver</a></li>
  126.     <li><a class="disabled" href="tests/PMO_MyDbms_Pgsql_Test.php">PMO_MyDbms with the PosgreSQL driver</a></li>
  127.     <li><a class="disabled" href="tests/PMO_MyDbms_Pdo_Mysql_Test.php">PMO_MyDbms with the Pdo MySQL driver</a></li>
  128.     <li><a class="disabled" href="tests/PMO_MyDbms_Pdo_Sqlite_Test.php">PMO_MyDbms with the Pdo Sqlite driver</a></li>
  129.     </ul>
  130. <li>Controller and objects
  131.     <ul>
  132.     <li><a href="tests/PMO_MyObject_Test.php">PMO_MyObject</a></li>
  133.     <li><a href="tests/PMO_MyController_Test.php">PMO_MyController</a></li>
  134.     <li><a class="disabled" href="tests/PMO_MyTable_Test.php">PMO_MyTable</a></li>
  135.     <li><a class="disabled" href="tests/PMO_MyMap_Test.php">PMO_MyMap</a></li>
  136.     </ul>
  137. </li>
  138.  
  139. </ul>
  140.  
  141.  
  142.  
  143. <?php /***********************************
  144.  
  145. Refaire ça plus tard et l'intégrer à PMO_HTMLReporter
  146.  
  147. <form method="POST" action="<?php echo $_SERVER['REQUEST_URI'];?>">
  148. <input name="go" type="hidden" value="1">
  149. <fieldset id="testlevel">
  150.     <legend>Detail Level</legend>
  151.     <input name="level" type="radio" value="0">Show only global results
  152.     <input name="level" type="radio" value="1">Show test cases results
  153.     <input name="level" type="radio" value="2">Show all tests
  154. </fieldset>
  155. <fieldset id="dbms">
  156.     <legend>PMO_MyDbms and DBMS drivers</legend>
  157.     <div><input name="tests" type="checkbox" value="PMO_Dbms_Mysql_Test">PMO_Dbms_Mysql</div>
  158.     <div class="disabled"><input name="tests" type="checkbox" value="PMO_Dbms_Mysqli_Test" disabled="disabled">PMO_Dbms_Mysqli</div>
  159.     <div class="disabled"><input name="tests" type="checkbox" value="PMO_Dbms_Pgsql_Test" disabled="disabled">PMO_Dbms_PgSql</div>
  160.     <div><input name="tests[]" type="checkbox" value="PMO_Dbms_Sqlite_Test">PMO_Dbms_Sqlite</div>
  161.     <div><input name="tests[]" type="checkbox" value="PMO_Dbms_Pdo_Test">PMO_Dbms_Pdo</div>
  162.     <div><input name="tests[]" type="checkbox" value="PMO_MyDbms_Test">PMO_MyDbms</div>
  163. </fieldset>
  164. <fieldset id="misc">
  165.     <legend>Miscellaneous</legend>
  166.     <div><input name="tests[]" type="checkbox" value="PMO_Myconfig_Test">PMO_MyConfig Test</div>
  167. </fieldset>
  168. <div id="go">
  169.     <input type="submit" value="Start the tests">
  170. </div>
  171. </form>
  172.  *****************************/
  173. ?>
  174.  
  175. </body>
  176. </html>

Documentation generated on Wed, 15 Oct 2008 09:15:29 -0400 by phpDocumentor 1.4.1