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:
parent
839af7f363
commit
e78f01591d
|
@ -467,7 +467,7 @@ EOD
|
|||
);
|
||||
}
|
||||
|
||||
public function testWhetherSectionAndPropertyOrderIsPreserved()
|
||||
public function testWhetherSectionAndPropertyOrderIsUpdated()
|
||||
{
|
||||
$config = <<<'EOD'
|
||||
[one]
|
||||
|
@ -483,6 +483,22 @@ d.e = "f"
|
|||
[three]
|
||||
key = "value"
|
||||
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;
|
||||
$target = $this->writeConfigToTemporaryFile($config);
|
||||
$writer = new PreservingIniWriter(
|
||||
|
@ -514,8 +530,8 @@ EOD;
|
|||
);
|
||||
|
||||
$this->assertEquals(
|
||||
$config,
|
||||
$writer->render(),
|
||||
trim($reverted),
|
||||
trim($writer->render()),
|
||||
'PreservingIniWriter does not preserve section and/or property order'
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue