2006-10-01 17:54:15 +04:00
|
|
|
<?php
|
|
|
|
ob_start();
|
|
|
|
|
|
|
|
|
2006-10-26 01:12:30 +04:00
|
|
|
require_once('ConfigurableTestCase.php');
|
|
|
|
require_once('ManagerTestCase.php');
|
|
|
|
require_once('ConnectionTestCase.php');
|
|
|
|
require_once('ConnectionTransactionTestCase.php');
|
|
|
|
require_once('TableTestCase.php');
|
|
|
|
require_once('EventListenerTestCase.php');
|
|
|
|
require_once('BatchIteratorTestCase.php');
|
|
|
|
require_once('CacheFileTestCase.php');
|
|
|
|
|
|
|
|
require_once('RecordTestCase.php');
|
|
|
|
require_once('RecordStateTestCase.php');
|
|
|
|
require_once('RecordFilterTestCase.php');
|
|
|
|
|
|
|
|
require_once('AccessTestCase.php');
|
|
|
|
require_once('ValidatorTestCase.php');
|
|
|
|
require_once('CollectionTestCase.php');
|
|
|
|
require_once('PessimisticLockingTestCase.php');
|
|
|
|
require_once('EventListenerChainTestCase.php');
|
|
|
|
require_once('CacheSqliteTestCase.php');
|
|
|
|
require_once('CollectionOffsetTestCase.php');
|
|
|
|
|
|
|
|
require_once('CacheQuerySqliteTestCase.php');
|
|
|
|
require_once('ViewTestCase.php');
|
|
|
|
require_once('RawSqlTestCase.php');
|
|
|
|
require_once('CustomPrimaryKeyTestCase.php');
|
|
|
|
require_once('FilterTestCase.php');
|
|
|
|
|
|
|
|
require_once('QueryTestCase.php');
|
|
|
|
require_once('QueryLimitTestCase.php');
|
|
|
|
require_once('QueryMultiJoinTestCase.php');
|
|
|
|
require_once('QueryReferenceModelTestCase.php');
|
|
|
|
require_once('QueryWhereTestCase.php');
|
|
|
|
require_once('QueryFromTestCase.php');
|
|
|
|
require_once('QueryConditionTestCase.php');
|
|
|
|
require_once('QueryComponentAliasTestCase.php');
|
|
|
|
require_once('QuerySubqueryTestCase.php');
|
|
|
|
require_once('QuerySelectTestCase.php');
|
2006-11-05 22:24:28 +03:00
|
|
|
require_once('QueryShortAliasesTestCase.php');
|
2006-10-26 01:12:30 +04:00
|
|
|
require_once('QueryDeleteTestCase.php');
|
|
|
|
require_once('QueryUpdateTestCase.php');
|
|
|
|
|
|
|
|
require_once('RelationAccessTestCase.php');
|
|
|
|
require_once('RelationTestCase.php');
|
|
|
|
require_once('RelationManyToManyTestCase.php');
|
|
|
|
|
|
|
|
|
2006-11-05 22:24:28 +03:00
|
|
|
require_once('DbTestCase.php');
|
|
|
|
require_once('DbProfilerTestCase.php');
|
|
|
|
|
2006-10-26 01:12:30 +04:00
|
|
|
require_once('SchemaTestCase.php');
|
|
|
|
require_once('ImportTestCase.php');
|
|
|
|
require_once('BooleanTestCase.php');
|
|
|
|
require_once('EnumTestCase.php');
|
|
|
|
|
|
|
|
require_once('DataDictSqliteTestCase.php');
|
2006-10-27 00:53:59 +04:00
|
|
|
require_once('DataDict/PgsqlTestCase.php');
|
|
|
|
|
|
|
|
|
2006-10-26 01:12:30 +04:00
|
|
|
require_once('CustomResultSetOrderTestCase.php');
|
2006-10-01 17:54:15 +04:00
|
|
|
|
|
|
|
error_reporting(E_ALL);
|
2006-10-26 01:12:30 +04:00
|
|
|
print '<pre>';
|
2006-10-01 17:54:15 +04:00
|
|
|
|
2006-10-26 01:12:30 +04:00
|
|
|
$test = new GroupTest('Doctrine Framework Unit Tests');
|
2006-10-27 03:05:55 +04:00
|
|
|
|
2006-11-05 22:24:28 +03:00
|
|
|
|
2006-11-08 02:12:05 +03:00
|
|
|
$test->addTestCase(new Doctrine_Db_Profiler_TestCase());
|
|
|
|
/**
|
|
|
|
$test->addTestCase(new Doctrine_Db_TestCase());
|
2006-11-05 22:24:28 +03:00
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Query_MultiJoin_TestCase());
|
|
|
|
|
2006-10-31 02:00:09 +03:00
|
|
|
$test->addTestCase(new Doctrine_Record_TestCase());
|
2006-10-23 23:55:30 +04:00
|
|
|
|
2006-11-05 22:24:28 +03:00
|
|
|
$test->addTestCase(new Doctrine_ConnectionTestCase());
|
|
|
|
|
2006-10-31 02:00:09 +03:00
|
|
|
$test->addTestCase(new Doctrine_DataDict_Pgsql_TestCase());
|
2006-10-23 23:55:30 +04:00
|
|
|
|
2006-10-26 01:12:30 +04:00
|
|
|
$test->addTestCase(new Doctrine_Relation_ManyToMany_TestCase());
|
|
|
|
|
2006-10-30 02:24:50 +03:00
|
|
|
$test->addTestCase(new Doctrine_Relation_TestCase());
|
|
|
|
|
2006-10-26 00:02:40 +04:00
|
|
|
$test->addTestCase(new Doctrine_Record_State_TestCase());
|
2006-10-20 22:21:42 +04:00
|
|
|
|
2006-11-05 22:24:28 +03:00
|
|
|
//$test->addTestCase(new Doctrine_Import_TestCase());
|
2006-10-26 00:02:40 +04:00
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_SchemaTestCase());
|
2006-10-01 17:54:15 +04:00
|
|
|
|
2006-10-08 22:12:27 +04:00
|
|
|
$test->addTestCase(new Doctrine_ValidatorTestCase());
|
|
|
|
|
2006-10-01 17:54:15 +04:00
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_EventListenerTestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Connection_Transaction_TestCase());
|
|
|
|
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_AccessTestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_TableTestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_ManagerTestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_BatchIteratorTestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_ConfigurableTestCase());
|
|
|
|
|
2006-10-19 00:17:49 +04:00
|
|
|
//$test->addTestCase(new Doctrine_Collection_Offset_TestCase());
|
2006-10-01 17:54:15 +04:00
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_PessimisticLockingTestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_ViewTestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Cache_Query_SqliteTestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_CustomPrimaryKeyTestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Filter_TestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_RawSql_TestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_CollectionTestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Query_ReferenceModel_TestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_DataDict_Sqlite_TestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_EventListener_Chain_TestCase());
|
|
|
|
|
2006-10-01 18:35:38 +04:00
|
|
|
$test->addTestCase(new Doctrine_RelationAccessTestCase());
|
|
|
|
|
2006-10-01 17:54:15 +04:00
|
|
|
$test->addTestCase(new Doctrine_CustomResultSetOrderTestCase());
|
|
|
|
|
2006-10-03 21:24:13 +04:00
|
|
|
$test->addTestCase(new Doctrine_BooleanTestCase());
|
|
|
|
|
2006-10-12 00:44:21 +04:00
|
|
|
$test->addTestCase(new Doctrine_Record_Filter_TestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Query_Condition_TestCase());
|
|
|
|
|
2006-10-03 21:24:13 +04:00
|
|
|
$test->addTestCase(new Doctrine_Query_ComponentAlias_TestCase());
|
|
|
|
|
2006-10-06 20:50:00 +04:00
|
|
|
$test->addTestCase(new Doctrine_Query_Subquery_TestCase());
|
|
|
|
|
2006-11-05 22:24:28 +03:00
|
|
|
$test->addTestCase(new Doctrine_EnumTestCase());
|
|
|
|
|
2006-10-18 21:37:20 +04:00
|
|
|
$test->addTestCase(new Doctrine_Query_TestCase());
|
2006-10-12 00:44:21 +04:00
|
|
|
|
2006-11-05 22:24:28 +03:00
|
|
|
$test->addTestCase(new Doctrine_Query_ShortAliases_TestCase());
|
|
|
|
|
2006-10-12 00:44:21 +04:00
|
|
|
$test->addTestCase(new Doctrine_Query_Where_TestCase());
|
|
|
|
|
2006-10-12 23:57:56 +04:00
|
|
|
$test->addTestCase(new Doctrine_Query_From_TestCase());
|
|
|
|
|
2006-10-18 21:37:20 +04:00
|
|
|
$test->addTestCase(new Doctrine_Query_Delete_TestCase());
|
|
|
|
|
2006-10-19 00:17:49 +04:00
|
|
|
$test->addTestCase(new Doctrine_Query_Update_TestCase());
|
2006-10-27 03:05:55 +04:00
|
|
|
|
2006-10-27 02:12:58 +04:00
|
|
|
$test->addTestCase(new Doctrine_Query_Limit_TestCase());
|
2006-10-08 22:12:27 +04:00
|
|
|
|
2006-11-08 02:12:05 +03:00
|
|
|
*/
|
|
|
|
$test->addTestCase(new Doctrine_Query_Select_TestCase());
|
|
|
|
|
2006-11-05 22:24:28 +03:00
|
|
|
|
2006-10-27 00:53:59 +04:00
|
|
|
|
2006-10-01 17:54:15 +04:00
|
|
|
//$test->addTestCase(new Doctrine_Cache_FileTestCase());
|
|
|
|
//$test->addTestCase(new Doctrine_Cache_SqliteTestCase());
|
|
|
|
|
|
|
|
class MyReporter extends HtmlReporter {
|
|
|
|
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";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (TextReporter::inCli()) {
|
|
|
|
if ($argc == 4)
|
|
|
|
{
|
|
|
|
$dsn = $argv[1];
|
|
|
|
$username = $argv[2];
|
|
|
|
$password = $argv[3];
|
|
|
|
}
|
|
|
|
exit ($test->run(new TextReporter()) ? 0 : 1);
|
|
|
|
} else {
|
|
|
|
if (isset($_POST))
|
|
|
|
{
|
2006-10-26 01:12:30 +04:00
|
|
|
$dsn = isset($_POST["dsn"])?$_POST["dsn"]:null;
|
|
|
|
$username = isset($_POST["username"])?$_POST["username"]:null;
|
|
|
|
$password = isset($_POST["password"])?$_POST["password"]:null;
|
2006-10-01 17:54:15 +04:00
|
|
|
}
|
|
|
|
$test->run(new MyReporter());
|
|
|
|
$output = ob_get_clean();
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
$cache = Doctrine_Manager::getInstance()->getCurrentConnection()->getCacheHandler();
|
|
|
|
if(isset($cache)) {
|
|
|
|
$a = $cache->getQueries();
|
|
|
|
print "Executed cache queries: ".count($a)."\n";
|
|
|
|
|
|
|
|
foreach($a as $query) {
|
|
|
|
print $query."\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
?>
|
|
|
|
<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>
|
|
|
|
<tr>
|
|
|
|
<td> </td>
|
|
|
|
<td><input type="submit" name="submit" /></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</form>
|
|
|
|
<h3>Tests</h3>
|
|
|
|
<pre>
|
|
|
|
<?php echo $output; ?>
|
|
|
|
</pre>
|
|
|
|
<h3>Queries</h3>
|
|
|
|
<pre>
|
|
|
|
<?php
|
|
|
|
$dbh = Doctrine_Manager::getInstance()->getCurrentConnection()->getDBH();
|
|
|
|
$a = $dbh->getQueries();
|
|
|
|
|
|
|
|
print "Executed queries: ".count($a)."\n";
|
|
|
|
|
|
|
|
foreach($a as $query) {
|
|
|
|
print $query."\n";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|