Test whether section comments are moved correctly

This commit is contained in:
Matthias Jentsch 2014-07-04 11:35:00 +02:00
parent e78f01591d
commit fa61b601d4

View File

@ -467,7 +467,7 @@ EOD
);
}
public function testWhetherSectionAndPropertyOrderIsUpdated()
public function testWhetherSectionOrderIsUpdated()
{
$config = <<<'EOD'
[one]
@ -536,6 +536,46 @@ EOD;
);
}
public function testWhetherCommentOrderIsUpdated()
{
$config = <<<'EOD'
; comment 1
[one]
; comment 2
[two]
EOD;
$reverted = <<<'EOD'
; comment 2
[two]
; comment 1
[one]
EOD;
$target = $this->writeConfigToTemporaryFile($config);
$writer = new PreservingIniWriter(
array(
'config' => new Zend_Config(
array(
'two' => array(),
'one' => array()
)
),
'filename' => $target
)
);
$this->assertEquals(
trim($reverted),
trim($writer->render()),
'PreservingIniWriter does not preserve section and/or property order'
);
}
public function testWhetherCommentsOnEmptyLinesArePreserved()
{
$config = <<<'EOD'