Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
--TEST--
2
regression test for bug #16590, named arrays with number as first key
3
--FILE--
4
<?php
5
//having the number key in the root structure did always work,
6
// but it fails when we have sub arrays - at least, when
7
// duplicateDirectives is activated (which it is by default)
8
//The root problem was parsing the array into the config structure
9
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc';
10
$conf = array(
11
    'DB' => array(
12
        '203' => 'mysql',
13
        'host' => 'localhost',
14
    ),
15
    'ok' => array(
16
 
17
        1 => 'bar',
18
    ),
19
    'ok2' => array(
20
        '0' => 'foo2',
21
        '1' => 'bar2',
22
    )
23
);
24
print_r($conf);
25
 
26
$arr_read = $config->parseConfig(
27
    $conf, 'phparray',
28
    array('duplicateDirectives' => true)
29
);
30
 
31
$arr_read = $arr_read->toArray();
32
print_r($arr_read['root']);
33
?>
34
--EXPECT--
35
Array
36
(
37
    [DB] => Array
38
        (
39
            [203] => mysql
40
            [host] => localhost
41
        )
42
 
43
    [ok] => Array
44
        (
45
            [0] => foo
46
            [1] => bar
47
        )
48
 
49
    [ok2] => Array
50
        (
51
            [0] => foo2
52
            [1] => bar2
53
        )
54
 
55
)
56
Array
57
(
58
    [DB] => Array
59
        (
60
            [203] => mysql
61
            [host] => localhost
62
        )
63
 
64
    [ok] => Array
65
        (
66
            [0] => foo
67
            [1] => bar
68
        )
69
 
70
    [ok2] => Array
71
        (
72
            [0] => foo2
73
            [1] => bar2
74
        )
75
 
76
)