Fix PreservingIniWriterTest section test case

The test case now tests whether the section order of the ini file is updated correctly and
not whether the section order is preserved

fixes #6625
This commit is contained in:
Matthias Jentsch 2014-07-03 17:22:51 +02:00
parent 839af7f363
commit e78f01591d
1 changed files with 19 additions and 3 deletions

View File

@ -467,7 +467,7 @@ EOD
); );
} }
public function testWhetherSectionAndPropertyOrderIsPreserved() public function testWhetherSectionAndPropertyOrderIsUpdated()
{ {
$config = <<<'EOD' $config = <<<'EOD'
[one] [one]
@ -483,6 +483,22 @@ d.e = "f"
[three] [three]
key = "value" key = "value"
foo.bar = "raboof" foo.bar = "raboof"
EOD;
$reverted = <<<'EOD'
[three]
key = "value"
foo.bar = "raboof"
[two]
a.b = "c"
d.e = "f"
[one]
key1 = "1"
key2 = "2"
EOD; EOD;
$target = $this->writeConfigToTemporaryFile($config); $target = $this->writeConfigToTemporaryFile($config);
$writer = new PreservingIniWriter( $writer = new PreservingIniWriter(
@ -514,8 +530,8 @@ EOD;
); );
$this->assertEquals( $this->assertEquals(
$config, trim($reverted),
$writer->render(), trim($writer->render()),
'PreservingIniWriter does not preserve section and/or property order' 'PreservingIniWriter does not preserve section and/or property order'
); );
} }