Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
--TEST--
2
HTML_TreeMenu tests for Bug #4950:  Using "kriesing" tree type the "nodeOptions" paramether is not working.
3
--CREDITS--
4
Chuck Burgess <ashnazg@php.net>
5
# created for v1.2.2 2008-05-06
6
--SKIPIF--
7
<?php
8
if (!file_exists(dirname(__FILE__) . '/config.php')) {
9
    die('skip No config.php found; cant connect to DB');
10
}
11
--FILE--
12
<?php
13
require_once dirname(__FILE__) . '/config.php';
14
 
15
echo '=====HTML_TreeMenu tests for Bug #9750:  Using "kriesing" tree type the "nodeOptions" paramether is not working.=====' . PHP_EOL . PHP_EOL;
16
 
17
echo 'TEST:  test case provided in bug report' . PHP_EOL;
18
 
19
require_once 'Tree/Tree.php';
20
require_once 'Tree/Memory.php';
21
require_once 'HTML/TreeMenu.php';
22
 
23
 
24
$options = array ('order' => 'name', 'table' => 'mytree');
25
 
26
$tree = Tree::setup('Memory_DBnested', $dbDsn, $options);
27
$tree->setup();
28
 
29
$nodeOptions = array(
30
    'text'          => '',
31
    'link'          => 'editCategory.php?id=',
32
    'icon'          => 'folder.gif',
33
    'expandedIcon'  => 'folder-expanded.gif',
34
    'class'         => '',
35
    'expanded'      => false,
36
    'linkTarget'    => '_self',
37
    'isDynamic'     => 'true',
38
    'ensureVisible' => '',
39
);
40
 
41
$options = array(
42
    'structure'   => $tree,
43
    'type'        => 'kriesing',
44
    'nodeOptions' => $nodeOptions
45
);
46
 
47
$menu = &HTML_TreeMenu::createFromStructure($options);
48
 
49
// Chose a generator. You can generate DHTML or a Listbox
50
$dhtml = &new HTML_TreeMenu_DHTML(
51
    $menu,
52
    array(
53
        'images'       => 'images',
54
        'defaultClass' => 'treeMenuDefault'
55
    )
56
);
57
$listbox = &new HTML_TreeMenu_ListBox(
58
    $menu,
59
    array(
60
        'images'       => 'images',
61
        'defaultClass' => 'treeMenuDefault'
62
    )
63
);
64
 
65
 
66
echo 'TEST:  using DHTML' . PHP_EOL;
67
echo $dhtml->toHTML();
68
 
69
echo 'TEST:  using Listbox' . PHP_EOL;
70
echo $listbox->toHTML();
71
 
72
?>
73
--EXPECT--
74
=====HTML_TreeMenu tests for Bug #9750:  Using "kriesing" tree type the "nodeOptions" paramether is not working.====="
75
 
76
TEST:  test case provided in bug report
77
TEST:  using DHTML
78
TEST:  using ListBox