2006-04-14 00:37:28 +04:00
|
|
|
<?php
|
2006-04-16 12:41:45 +04:00
|
|
|
ob_start();
|
2006-05-24 12:46:43 +04:00
|
|
|
|
2006-09-24 16:55:25 +04:00
|
|
|
|
2006-06-07 00:37:56 +04:00
|
|
|
require_once("ConfigurableTestCase.php");
|
|
|
|
require_once("ManagerTestCase.php");
|
2006-08-22 03:20:33 +04:00
|
|
|
require_once("ConnectionTestCase.php");
|
2006-06-07 00:37:56 +04:00
|
|
|
require_once("TableTestCase.php");
|
|
|
|
require_once("EventListenerTestCase.php");
|
|
|
|
require_once("BatchIteratorTestCase.php");
|
|
|
|
require_once("CacheFileTestCase.php");
|
|
|
|
require_once("RecordTestCase.php");
|
|
|
|
require_once("AccessTestCase.php");
|
|
|
|
require_once("ValidatorTestCase.php");
|
|
|
|
require_once("CollectionTestCase.php");
|
2006-06-07 16:16:00 +04:00
|
|
|
require_once("PessimisticLockingTestCase.php");
|
2006-09-24 23:57:58 +04:00
|
|
|
require_once("EventListenerChainTestCase.php");
|
2006-06-07 00:37:56 +04:00
|
|
|
require_once("CacheSqliteTestCase.php");
|
|
|
|
require_once("CollectionOffsetTestCase.php");
|
|
|
|
require_once("QueryTestCase.php");
|
2006-06-13 22:04:04 +04:00
|
|
|
require_once("CacheQuerySqliteTestCase.php");
|
|
|
|
require_once("ViewTestCase.php");
|
2006-07-22 03:22:15 +04:00
|
|
|
require_once("RawSqlTestCase.php");
|
2006-07-26 21:09:00 +04:00
|
|
|
require_once("CustomPrimaryKeyTestCase.php");
|
2006-07-27 21:51:19 +04:00
|
|
|
require_once("FilterTestCase.php");
|
2006-08-07 13:55:46 +04:00
|
|
|
require_once("ValueHolderTestCase.php");
|
2006-08-16 01:33:41 +04:00
|
|
|
require_once("QueryLimitTestCase.php");
|
2006-09-18 21:32:12 +04:00
|
|
|
require_once("QueryReferenceModelTestCase.php");
|
2006-09-23 21:02:30 +04:00
|
|
|
require_once("DBTestCase.php");
|
2006-08-27 02:27:16 +04:00
|
|
|
require_once("SchemaTestCase.php");
|
|
|
|
require_once("ImportTestCase.php");
|
2006-09-22 01:18:30 +04:00
|
|
|
require_once("BooleanTestCase.php");
|
2006-09-22 12:07:49 +04:00
|
|
|
require_once("EnumTestCase.php");
|
2006-09-23 15:56:57 +04:00
|
|
|
require_once("RelationAccessTestCase.php");
|
2006-09-27 01:12:14 +04:00
|
|
|
require_once("DataDictSqliteTestCase.php");
|
2006-04-14 00:37:28 +04:00
|
|
|
error_reporting(E_ALL);
|
|
|
|
|
|
|
|
$test = new GroupTest("Doctrine Framework Unit Tests");
|
2006-09-20 13:35:29 +04:00
|
|
|
|
2006-09-27 22:02:13 +04:00
|
|
|
|
2006-09-20 13:35:29 +04:00
|
|
|
$test->addTestCase(new Doctrine_ConnectionTestCase());
|
|
|
|
|
2006-09-27 22:02:13 +04:00
|
|
|
$test->addTestCase(new Doctrine_DB_TestCase());
|
|
|
|
|
2006-09-16 00:56:25 +04:00
|
|
|
$test->addTestCase(new Doctrine_RecordTestCase());
|
2006-09-14 00:47:29 +04:00
|
|
|
|
2006-09-16 00:56:25 +04:00
|
|
|
$test->addTestCase(new Doctrine_AccessTestCase());
|
2006-09-12 14:15:58 +04:00
|
|
|
|
2006-09-16 00:56:25 +04:00
|
|
|
$test->addTestCase(new Doctrine_EventListenerTestCase());
|
2006-05-31 12:46:44 +04:00
|
|
|
|
2006-09-09 03:20:51 +04:00
|
|
|
$test->addTestCase(new Doctrine_TableTestCase());
|
|
|
|
|
2006-04-14 00:37:28 +04:00
|
|
|
$test->addTestCase(new Doctrine_ManagerTestCase());
|
2006-08-23 00:14:29 +04:00
|
|
|
|
2006-04-17 01:23:38 +04:00
|
|
|
$test->addTestCase(new Doctrine_BatchIteratorTestCase());
|
2006-04-16 00:52:23 +04:00
|
|
|
|
2006-04-17 00:38:17 +04:00
|
|
|
$test->addTestCase(new Doctrine_ConfigurableTestCase());
|
2006-04-17 02:46:05 +04:00
|
|
|
|
2006-09-20 13:35:29 +04:00
|
|
|
$test->addTestCase(new Doctrine_ValidatorTestCase());
|
|
|
|
|
2006-04-19 20:01:36 +04:00
|
|
|
$test->addTestCase(new Doctrine_Collection_OffsetTestCase());
|
2006-05-10 01:38:34 +04:00
|
|
|
|
2006-06-08 17:17:15 +04:00
|
|
|
$test->addTestCase(new Doctrine_PessimisticLockingTestCase());
|
|
|
|
|
2006-06-14 23:17:38 +04:00
|
|
|
$test->addTestCase(new Doctrine_ViewTestCase());
|
|
|
|
|
2006-06-19 02:45:54 +04:00
|
|
|
$test->addTestCase(new Doctrine_Cache_Query_SqliteTestCase());
|
|
|
|
|
2006-07-26 21:09:00 +04:00
|
|
|
$test->addTestCase(new Doctrine_CustomPrimaryKeyTestCase());
|
|
|
|
|
2006-07-27 21:51:19 +04:00
|
|
|
$test->addTestCase(new Doctrine_Filter_TestCase());
|
|
|
|
|
2006-08-07 13:55:46 +04:00
|
|
|
$test->addTestCase(new Doctrine_ValueHolder_TestCase());
|
2006-08-16 01:32:59 +04:00
|
|
|
|
2006-08-22 02:04:13 +04:00
|
|
|
$test->addTestCase(new Doctrine_RawSql_TestCase());
|
2006-08-22 02:51:27 +04:00
|
|
|
|
2006-08-23 01:18:06 +04:00
|
|
|
$test->addTestCase(new Doctrine_Query_Limit_TestCase());
|
2006-09-27 22:02:13 +04:00
|
|
|
|
2006-09-27 01:12:14 +04:00
|
|
|
//$test->addTestCase(new Doctrine_SchemaTestCase());
|
2006-08-27 02:27:16 +04:00
|
|
|
|
2006-09-27 01:12:14 +04:00
|
|
|
//$test->addTestCase(new Doctrine_ImportTestCase());
|
2006-09-27 22:02:13 +04:00
|
|
|
|
2006-09-14 00:47:29 +04:00
|
|
|
$test->addTestCase(new Doctrine_CollectionTestCase());
|
2006-09-15 14:04:22 +04:00
|
|
|
|
2006-09-18 21:32:12 +04:00
|
|
|
$test->addTestCase(new Doctrine_Query_ReferenceModel_TestCase());
|
2006-09-03 23:20:02 +04:00
|
|
|
|
2006-09-24 16:55:25 +04:00
|
|
|
$test->addTestCase(new Doctrine_QueryTestCase());
|
|
|
|
|
2006-09-22 12:07:49 +04:00
|
|
|
$test->addTestCase(new Doctrine_EnumTestCase());
|
2006-09-09 03:20:51 +04:00
|
|
|
|
2006-09-24 23:57:58 +04:00
|
|
|
$test->addTestCase(new Doctrine_RelationAccessTestCase());
|
2006-09-23 15:56:57 +04:00
|
|
|
|
2006-09-24 23:57:58 +04:00
|
|
|
$test->addTestCase(new Doctrine_EventListener_Chain_TestCase());
|
2006-09-27 01:12:14 +04:00
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_DataDict_Sqlite_TestCase());
|
2006-09-27 22:02:13 +04:00
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_BooleanTestCase());
|
2006-09-28 01:21:33 +04:00
|
|
|
|
2006-04-15 14:15:16 +04:00
|
|
|
//$test->addTestCase(new Doctrine_Cache_FileTestCase());
|
|
|
|
//$test->addTestCase(new Doctrine_Cache_SqliteTestCase());
|
|
|
|
|
2006-09-24 21:11:05 +04:00
|
|
|
class MyReporter extends HtmlReporter {
|
2006-09-25 12:42:15 +04:00
|
|
|
public function paintHeader() {}
|
|
|
|
public function paintFooter()
|
|
|
|
{
|
|
|
|
$colour = ($this->getFailCount() + $this->getExceptionCount() > 0 ? "red" : "green");
|
|
|
|
print "<div style=\"";
|
|
|
|
print "padding: 8px; margin-top: 1em; background-color: $colour; color: white;";
|
|
|
|
print "\">";
|
|
|
|
print $this->getTestCaseProgress() . "/" . $this->getTestCaseCount();
|
|
|
|
print " test cases complete:\n";
|
|
|
|
print "<strong>" . $this->getPassCount() . "</strong> passes, ";
|
|
|
|
print "<strong>" . $this->getFailCount() . "</strong> fails and ";
|
|
|
|
print "<strong>" . $this->getExceptionCount() . "</strong> exceptions.";
|
|
|
|
print "</div>\n";
|
|
|
|
}
|
2006-09-24 21:11:05 +04:00
|
|
|
}
|
2006-04-14 00:37:28 +04:00
|
|
|
|
2006-09-25 11:10:37 +04:00
|
|
|
if (TextReporter::inCli()) {
|
2006-09-25 12:42:15 +04:00
|
|
|
if ($argc == 4)
|
|
|
|
{
|
|
|
|
$dsn = $argv[1];
|
|
|
|
$username = $argv[2];
|
|
|
|
$password = $argv[3];
|
|
|
|
}
|
2006-09-25 11:10:37 +04:00
|
|
|
exit ($test->run(new TextReporter()) ? 0 : 1);
|
2006-09-25 12:42:15 +04:00
|
|
|
} else {
|
|
|
|
if (isset($_POST))
|
|
|
|
{
|
2006-09-27 01:12:14 +04:00
|
|
|
$dsn = isset($_POST['dsn'])?$_POST['dsn']:null;
|
|
|
|
$username = isset($_POST['username'])?$_POST['username']:null;
|
|
|
|
$password = isset($_POST['password'])?$_POST['password']:null;
|
2006-09-25 12:42:15 +04:00
|
|
|
}
|
|
|
|
$test->run(new MyReporter());
|
|
|
|
$output = ob_get_clean();
|
2006-09-25 11:10:37 +04:00
|
|
|
}
|
2006-06-30 03:04:39 +04:00
|
|
|
/**
|
2006-08-22 03:20:33 +04:00
|
|
|
$cache = Doctrine_Manager::getInstance()->getCurrentConnection()->getCacheHandler();
|
2006-04-15 14:15:16 +04:00
|
|
|
if(isset($cache)) {
|
|
|
|
$a = $cache->getQueries();
|
|
|
|
print "Executed cache queries: ".count($a)."\n";
|
2006-06-30 03:04:39 +04:00
|
|
|
|
2006-04-15 14:15:16 +04:00
|
|
|
foreach($a as $query) {
|
|
|
|
print $query."\n";
|
|
|
|
}
|
2006-06-30 03:04:39 +04:00
|
|
|
|
2006-04-15 14:15:16 +04:00
|
|
|
}
|
2006-06-30 03:04:39 +04:00
|
|
|
*/
|
2006-09-24 21:11:05 +04:00
|
|
|
?>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
|
|
|
|
<title>Doctrine Unit Tests</title>
|
|
|
|
<style>
|
|
|
|
.fail { color: red; } pre { background-color: lightgray; }
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<h1>Doctrine Unit Tests</h1>
|
|
|
|
<h3>DSN Settings</h3>
|
|
|
|
<form method="post">
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<th>DSN</th>
|
|
|
|
<td><input type="text" name="dsn" /></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Username</th>
|
|
|
|
<td><input type="text" name="username" /></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Password</th>
|
|
|
|
<td><input type="text" name="password" /></td>
|
|
|
|
</tr>
|
2006-09-25 12:42:15 +04:00
|
|
|
<tr>
|
|
|
|
<td> </td>
|
|
|
|
<td><input type="submit" name="submit" /></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2006-09-24 21:11:05 +04:00
|
|
|
</form>
|
|
|
|
<h3>Tests</h3>
|
|
|
|
<pre>
|
|
|
|
<?php echo $output; ?>
|
|
|
|
</pre>
|
|
|
|
<h3>Queries</h3>
|
|
|
|
<pre>
|
|
|
|
<?php
|
2006-08-22 03:20:33 +04:00
|
|
|
$dbh = Doctrine_Manager::getInstance()->getCurrentConnection()->getDBH();
|
2006-04-14 14:20:19 +04:00
|
|
|
$a = $dbh->getQueries();
|
2006-04-14 00:37:28 +04:00
|
|
|
|
|
|
|
print "Executed queries: ".count($a)."\n";
|
|
|
|
|
|
|
|
foreach($a as $query) {
|
|
|
|
print $query."\n";
|
|
|
|
}
|
|
|
|
?>
|
2006-09-24 21:11:05 +04:00
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|