run.php 2.67 KB
Newer Older
doctrine's avatar
doctrine committed
1
<?php
doctrine's avatar
doctrine committed
2
ob_start();
doctrine's avatar
doctrine committed
3

4 5 6 7 8 9 10 11 12 13 14
require_once("ConfigurableTestCase.php");
require_once("ManagerTestCase.php");
require_once("SessionTestCase.php");
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");
15
require_once("PessimisticLockingTestCase.php");
16 17 18 19

require_once("CacheSqliteTestCase.php");
require_once("CollectionOffsetTestCase.php");
require_once("QueryTestCase.php");
20 21
require_once("CacheQuerySqliteTestCase.php");
require_once("ViewTestCase.php");
22
require_once("RawSqlTestCase.php");
23
require_once("CustomPrimaryKeyTestCase.php");
24
require_once("FilterTestCase.php");
25
require_once("ValueHolderTestCase.php");
doctrine's avatar
doctrine committed
26

doctrine's avatar
doctrine committed
27 28 29 30
error_reporting(E_ALL);

$test = new GroupTest("Doctrine Framework Unit Tests");

31
$test->addTestCase(new Doctrine_RecordTestCase());
doctrine's avatar
doctrine committed
32

doctrine's avatar
doctrine committed
33
$test->addTestCase(new Doctrine_SessionTestCase());
doctrine's avatar
doctrine committed
34

doctrine's avatar
doctrine committed
35
$test->addTestCase(new Doctrine_TableTestCase());
doctrine's avatar
doctrine committed
36

doctrine's avatar
doctrine committed
37 38 39
$test->addTestCase(new Doctrine_ValidatorTestCase());

$test->addTestCase(new Doctrine_ManagerTestCase());
40

doctrine's avatar
doctrine committed
41
$test->addTestCase(new Doctrine_AccessTestCase());
doctrine's avatar
doctrine committed
42

doctrine's avatar
doctrine committed
43
$test->addTestCase(new Doctrine_EventListenerTestCase());
doctrine's avatar
doctrine committed
44

45
$test->addTestCase(new Doctrine_BatchIteratorTestCase());
46

doctrine's avatar
doctrine committed
47
$test->addTestCase(new Doctrine_ConfigurableTestCase());
doctrine's avatar
doctrine committed
48

doctrine's avatar
doctrine committed
49
$test->addTestCase(new Doctrine_Collection_OffsetTestCase());
50

doctrine's avatar
doctrine committed
51
$test->addTestCase(new Doctrine_CollectionTestCase());
doctrine's avatar
doctrine committed
52

53 54
$test->addTestCase(new Doctrine_PessimisticLockingTestCase());

55 56
$test->addTestCase(new Doctrine_ViewTestCase());

57 58
$test->addTestCase(new Doctrine_Cache_Query_SqliteTestCase());

59
$test->addTestCase(new Doctrine_QueryTestCase());
doctrine's avatar
doctrine committed
60

61
$test->addTestCase(new Doctrine_RawSql_TestCase());
62

63 64
$test->addTestCase(new Doctrine_CustomPrimaryKeyTestCase());

65 66
$test->addTestCase(new Doctrine_Filter_TestCase());

67
$test->addTestCase(new Doctrine_ValueHolder_TestCase());
doctrine's avatar
doctrine committed
68 69 70
//$test->addTestCase(new Doctrine_Cache_FileTestCase());
//$test->addTestCase(new Doctrine_Cache_SqliteTestCase());

doctrine's avatar
doctrine committed
71

doctrine's avatar
doctrine committed
72
print "<pre>";
doctrine's avatar
doctrine committed
73
$test->run(new HtmlReporter());
doctrine's avatar
doctrine committed
74
/**
doctrine's avatar
doctrine committed
75 76 77 78
$cache = Doctrine_Manager::getInstance()->getCurrentSession()->getCacheHandler();
if(isset($cache)) {
    $a     = $cache->getQueries();
    print "Executed cache queries: ".count($a)."\n";
doctrine's avatar
doctrine committed
79

doctrine's avatar
doctrine committed
80 81 82
    foreach($a as $query) {
        print $query."\n";
    }
doctrine's avatar
doctrine committed
83

doctrine's avatar
doctrine committed
84
}
doctrine's avatar
doctrine committed
85
*/
doctrine's avatar
doctrine committed
86

doctrine's avatar
doctrine committed
87 88
$dbh = Doctrine_Manager::getInstance()->getCurrentSession()->getDBH();
$a   = $dbh->getQueries();
doctrine's avatar
doctrine committed
89 90 91 92 93 94

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

foreach($a as $query) {
    print $query."\n";
}
doctrine's avatar
doctrine committed
95
ob_end_flush();
doctrine's avatar
doctrine committed
96
?>