run.php 2.97 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
require_once("ConfigurableTestCase.php");
require_once("ManagerTestCase.php");
zYne's avatar
zYne committed
6
require_once("ConnectionTestCase.php");
7 8 9 10 11 12 13 14
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");
pookey's avatar
pookey committed
26
require_once("QueryLimitTestCase.php");
doctrine's avatar
doctrine committed
27

28 29 30
require_once("SchemaTestCase.php");
require_once("ImportTestCase.php");

doctrine's avatar
doctrine committed
31 32 33
error_reporting(E_ALL);

$test = new GroupTest("Doctrine Framework Unit Tests");
zYne's avatar
zYne committed
34

35 36
$test->addTestCase(new Doctrine_EventListenerTestCase());

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

39 40
$test->addTestCase(new Doctrine_TableTestCase());

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

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

45
$test->addTestCase(new Doctrine_AccessTestCase());   
doctrine's avatar
doctrine committed
46

47
$test->addTestCase(new Doctrine_BatchIteratorTestCase());
48

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

doctrine's avatar
doctrine committed
51
$test->addTestCase(new Doctrine_Collection_OffsetTestCase());
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 60
$test->addTestCase(new Doctrine_CustomPrimaryKeyTestCase());

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

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

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

67
$test->addTestCase(new Doctrine_Query_Limit_TestCase());
zYne's avatar
zYne committed
68

69 70 71 72
$test->addTestCase(new Doctrine_SchemaTestCase());

$test->addTestCase(new Doctrine_ImportTestCase());

73 74 75 76
$test->addTestCase(new Doctrine_ValidatorTestCase());

$test->addTestCase(new Doctrine_QueryTestCase());

77
$test->addTestCase(new Doctrine_CollectionTestCase());
zYne's avatar
zYne committed
78

79 80


doctrine's avatar
doctrine committed
81 82 83
//$test->addTestCase(new Doctrine_Cache_FileTestCase());
//$test->addTestCase(new Doctrine_Cache_SqliteTestCase());

doctrine's avatar
doctrine committed
84

doctrine's avatar
doctrine committed
85
print "<pre>";
doctrine's avatar
doctrine committed
86
$test->run(new HtmlReporter());
doctrine's avatar
doctrine committed
87
/**
zYne's avatar
zYne committed
88
$cache = Doctrine_Manager::getInstance()->getCurrentConnection()->getCacheHandler();
doctrine's avatar
doctrine committed
89 90 91
if(isset($cache)) {
    $a     = $cache->getQueries();
    print "Executed cache queries: ".count($a)."\n";
doctrine's avatar
doctrine committed
92

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

doctrine's avatar
doctrine committed
97
}
doctrine's avatar
doctrine committed
98
*/
doctrine's avatar
doctrine committed
99

zYne's avatar
zYne committed
100
$dbh = Doctrine_Manager::getInstance()->getCurrentConnection()->getDBH();
doctrine's avatar
doctrine committed
101
$a   = $dbh->getQueries();
doctrine's avatar
doctrine committed
102 103 104 105 106 107

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

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