addTestCase(new Doctrine_ConnectionTestCase()); $test->addTestCase(new Doctrine_DB_TestCase()); $test->addTestCase(new Doctrine_RecordTestCase()); $test->addTestCase(new Doctrine_AccessTestCase()); $test->addTestCase(new Doctrine_EventListenerTestCase()); $test->addTestCase(new Doctrine_TableTestCase()); $test->addTestCase(new Doctrine_ManagerTestCase()); $test->addTestCase(new Doctrine_BatchIteratorTestCase()); $test->addTestCase(new Doctrine_ConfigurableTestCase()); $test->addTestCase(new Doctrine_ValidatorTestCase()); $test->addTestCase(new Doctrine_Collection_OffsetTestCase()); $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_ValueHolder_TestCase()); $test->addTestCase(new Doctrine_RawSql_TestCase()); $test->addTestCase(new Doctrine_Query_Limit_TestCase()); //$test->addTestCase(new Doctrine_SchemaTestCase()); //$test->addTestCase(new Doctrine_ImportTestCase()); $test->addTestCase(new Doctrine_CollectionTestCase()); $test->addTestCase(new Doctrine_Query_ReferenceModel_TestCase()); $test->addTestCase(new Doctrine_QueryTestCase()); $test->addTestCase(new Doctrine_EnumTestCase()); $test->addTestCase(new Doctrine_RelationAccessTestCase()); $test->addTestCase(new Doctrine_EventListener_Chain_TestCase()); $test->addTestCase(new Doctrine_DataDict_Sqlite_TestCase()); $test->addTestCase(new Doctrine_BooleanTestCase()); //$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 "
"; print $this->getTestCaseProgress() . "/" . $this->getTestCaseCount(); print " test cases complete:\n"; print "" . $this->getPassCount() . " passes, "; print "" . $this->getFailCount() . " fails and "; print "" . $this->getExceptionCount() . " exceptions."; print "
\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)) { $dsn = isset($_POST['dsn'])?$_POST['dsn']:null; $username = isset($_POST['username'])?$_POST['username']:null; $password = isset($_POST['password'])?$_POST['password']:null; } $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"; } } */ ?> Doctrine Unit Tests

Doctrine Unit Tests

DSN Settings

DSN
Username
Password
 

Tests


Queries

getCurrentConnection()->getDBH();
$a   = $dbh->getQueries();

print "Executed queries: ".count($a)."\n";

foreach($a as $query) {
    print $query."\n";
}
?>