Skip to content

Commit

Permalink
Unit test for phalcon#829
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Jul 13, 2013
1 parent 36c4d0e commit 61d90f1
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
23 changes: 22 additions & 1 deletion unit-tests/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,5 +231,26 @@ public function testIssue732()
unset($a['a']);
$this->assertTrue(!isset($a['a']));
}
}

public function testIssue829()
{
$config = new \Phalcon\Config\Adapter\Ini('unit-tests/config/829-no-sections.ini');
$actual = $config->toArray();
$expected = array(
'hoge' => 'test',
'foo' => 'bar',
);

$this->assertEquals($actual, $expected);

$config = new \Phalcon\Config\Adapter\Ini('unit-tests/config/829-with-empty-section.ini');
$actual = $config->toArray();
$expected = array(
'section' => array('hoge' => 'test'),
'empty' => array(),
'test' => array('foo' => 'bar'),
);

$this->assertEquals($actual, $expected);
}
}
2 changes: 2 additions & 0 deletions unit-tests/config/829-no-sections.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
hoge=test
foo=bar
7 changes: 7 additions & 0 deletions unit-tests/config/829-with-empty-section.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[section]
hoge=test

[empty]

[test]
foo=bar
Empty file modified unit-tests/config/config.ini
100755 → 100644
Empty file.

0 comments on commit 61d90f1

Please sign in to comment.