BrowscapTest\Parser\IniParserTest::testParseWithSorting PHP Method

testParseWithSorting() public method

tests parsing sections with sorting
    public function testParseWithSorting()
    {
        $lines = ['', ';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; division1', '', '; this line is a comment', '[section1]', 'property11=value11', 'property12=value12', '', '; this line is a comment', '[section2]', 'property21=value21', 'property22=value22', '', ';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; division2', '', '; this line is a comment', '[section3]', 'property31=value31', 'property32=value32'];
        $parser = new IniParser('');
        $parser->setFileLines($lines);
        $parser->setShouldSort(true);
        $expected = ['section1' => ['Division' => 'division1', 'property11' => 'value11', 'property12' => 'value12'], 'section2' => ['Division' => 'division1', 'property21' => 'value21', 'property22' => 'value22'], 'section3' => ['Division' => 'division2', 'property31' => 'value31', 'property32' => 'value32']];
        $data = $parser->parse();
        self::assertSame($expected, $data);
    }