run.php 3.09 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");
zYne's avatar
zYne committed
27
require_once("QueryReferenceModelTestCase.php");
doctrine's avatar
doctrine committed
28

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

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

$test = new GroupTest("Doctrine Framework Unit Tests");
35 36 37 38 39 40




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

41
$test->addTestCase(new Doctrine_RecordTestCase());
42

43
$test->addTestCase(new Doctrine_AccessTestCase());
44

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

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

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

51
$test->addTestCase(new Doctrine_BatchIteratorTestCase());
52

doctrine's avatar
doctrine committed
53
$test->addTestCase(new Doctrine_ConfigurableTestCase());
doctrine's avatar
doctrine committed
54

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

doctrine's avatar
doctrine committed
57
$test->addTestCase(new Doctrine_Collection_OffsetTestCase());
58

59 60
$test->addTestCase(new Doctrine_PessimisticLockingTestCase());

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

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

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

67 68
$test->addTestCase(new Doctrine_Filter_TestCase());

69
$test->addTestCase(new Doctrine_ValueHolder_TestCase());
70

71
$test->addTestCase(new Doctrine_RawSql_TestCase());
72

73
$test->addTestCase(new Doctrine_Query_Limit_TestCase());
zYne's avatar
zYne committed
74

75 76 77 78
$test->addTestCase(new Doctrine_SchemaTestCase());

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

79
$test->addTestCase(new Doctrine_CollectionTestCase());
80

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

zYne's avatar
zYne committed
83
$test->addTestCase(new Doctrine_Query_ReferenceModel_TestCase());
zYne's avatar
zYne committed
84

85 86


doctrine's avatar
doctrine committed
87 88 89
//$test->addTestCase(new Doctrine_Cache_FileTestCase());
//$test->addTestCase(new Doctrine_Cache_SqliteTestCase());

doctrine's avatar
doctrine committed
90

doctrine's avatar
doctrine committed
91
print "<pre>";
doctrine's avatar
doctrine committed
92
$test->run(new HtmlReporter());
doctrine's avatar
doctrine committed
93
/**
zYne's avatar
zYne committed
94
$cache = Doctrine_Manager::getInstance()->getCurrentConnection()->getCacheHandler();
doctrine's avatar
doctrine committed
95 96 97
if(isset($cache)) {
    $a     = $cache->getQueries();
    print "Executed cache queries: ".count($a)."\n";
doctrine's avatar
doctrine committed
98

doctrine's avatar
doctrine committed
99 100 101
    foreach($a as $query) {
        print $query."\n";
    }
doctrine's avatar
doctrine committed
102

doctrine's avatar
doctrine committed
103
}
doctrine's avatar
doctrine committed
104
*/
doctrine's avatar
doctrine committed
105

zYne's avatar
zYne committed
106
$dbh = Doctrine_Manager::getInstance()->getCurrentConnection()->getDBH();
doctrine's avatar
doctrine committed
107
$a   = $dbh->getQueries();
doctrine's avatar
doctrine committed
108 109 110 111 112 113

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

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