コード例 #1
0
ファイル: ConfigResourceTest.php プロジェクト: jbarentsen/drb
    public function testTraverseArrayFlattensToDotSeparatedKeyValuePairs()
    {
        $config = array(
            'foo' => 'bar',
            'bar' => array(
                'baz' => 'bat',
                'bat' => 'bogus',
            ),
            'baz' => 'not what you think',
        );
        $expected = array(
            'foo'     => 'bar',
            'bar.baz' => 'bat',
            'bar.bat' => 'bogus',
            'baz'     => 'not what you think',
        );

        $this->assertEquals($expected, $this->configResource->traverseArray($config));
    }