| 1 |
lars |
1 |
<?php
|
|
|
2 |
//
|
|
|
3 |
// $Id: getIdByPath.php,v 1.3 2004/12/21 17:06:02 dufuz Exp $
|
|
|
4 |
//
|
|
|
5 |
|
|
|
6 |
require_once 'UnitTest.php';
|
|
|
7 |
|
|
|
8 |
class tests_getIdByPath extends UnitTest
|
|
|
9 |
{
|
|
|
10 |
// check if we get the right ID, for the given path
|
|
|
11 |
function test_MemoryDBnested()
|
|
|
12 |
{
|
|
|
13 |
$tree = $this->getMemoryDBnested();
|
|
|
14 |
$id = $tree->getIdByPath('/Root/child 2/child 2_2');
|
|
|
15 |
|
|
|
16 |
$this->assertEquals(5, $id);
|
|
|
17 |
}
|
|
|
18 |
|
|
|
19 |
function test_MemoryMDBnested()
|
|
|
20 |
{
|
|
|
21 |
$tree = $this->getMemoryMDBnested();
|
|
|
22 |
$id = $tree->getIdByPath('/Root/child 2/child 2_2');
|
|
|
23 |
|
|
|
24 |
$this->assertEquals(5, $id);
|
|
|
25 |
}
|
|
|
26 |
|
|
|
27 |
// do this for XML
|
|
|
28 |
|
|
|
29 |
// do this for Filesystem
|
|
|
30 |
|
|
|
31 |
// do this for DBsimple
|
|
|
32 |
|
|
|
33 |
// do this for DynamicDBnested
|
|
|
34 |
function test_DynamicDBnested()
|
|
|
35 |
{
|
|
|
36 |
$tree = $this->getDynamicDBnested();
|
|
|
37 |
$id = $tree->getIdByPath('/Root/child 2/child 2_2');
|
|
|
38 |
|
|
|
39 |
$this->assertEquals(5, $id,'This is not implemented, yet!!! (This test should fail ... for now)');
|
|
|
40 |
}
|
|
|
41 |
|
|
|
42 |
function test_DynamicMDBnested()
|
|
|
43 |
{
|
|
|
44 |
$tree = $this->getDynamicMDBnested();
|
|
|
45 |
$id = $tree->getIdByPath('/Root/child 2/child 2_2');
|
|
|
46 |
|
|
|
47 |
$this->assertEquals(5, $id,'This is not implemented, yet!!! (This test should fail ... for now)');
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
}
|
|
|
51 |
|
|
|
52 |
?>
|