Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
//
3
//  $Id: UnitTest.php,v 1.3 2004/12/21 17:06:02 dufuz Exp $
4
//
5
 
6
require_once 'DB.php';
7
require_once 'PHPUnit.php';
8
 
9
class UnitTest extends PhpUnit_TestCase
10
{
11
    function setUp()
12
    {
13
        // common setup, setup the table structure and data in the db
14
        // (this actually also does the tearDown, since we have the DROP TABLE queries in the setup too
15
        require 'sql.php';
16
        $db = DB::connect(DB_DSN);
17
        foreach ($dbStructure[$db->phptype]['setup'] as $aQuery) {
18
            if (DB::isError($ret = $db->query($aQuery))) {
19
                die($ret->getUserInfo());
20
            }
21
        }
22
 
23
        $this->setLooselyTyped(true);
24
    }
25
 
26
    function tearDown()
27
    {
28
/*        global $dbStructure;
29
 
30
        $querytool = new Common();
31
        foreach ($dbStructure[$querytool->db->phptype]['tearDown'] as $aQuery) {
32
//print "$aQuery<br><br>";
33
            if (DB::isError($ret=$querytool->db->query($aQuery))) {
34
                die($ret->getUserInfo());
35
            }
36
        }
37
*/
38
    }
39
 
40
    function &getMemoryDBnested()
41
    {
42
        $tree = Tree::setup('Memory_DBnested', DB_DSN, array('table' => TABLE_TREENESTED));
43
        $tree->setup();
44
        return $tree;
45
    }
46
 
47
    function &getDynamicDBnested()
48
    {
49
        $tree = Tree::setup('Dynamic_DBnested', DB_DSN, array('table' => TABLE_TREENESTED));
50
        return $tree;
51
    }
52
 
53
    function &getMemoryMDBnested()
54
    {
55
        $tree = Tree::setup('Memory_MDBnested', DB_DSN, array('table' => TABLE_TREENESTED));
56
        $tree->setup();
57
        return $tree;
58
    }
59
 
60
    function &getDynamicMDBnested()
61
    {
62
        $tree = Tree::setup('Dynamic_MDBnested', DB_DSN, array('table' => TABLE_TREENESTED));
63
        return $tree;
64
    }
65
 
66
}
67
 
68
?>