mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 00:34:03 +02:00
Test whether section comments are moved correctly
This commit is contained in:
parent
e78f01591d
commit
fa61b601d4
@ -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'
|
||||
|
Loading…
x
Reference in New Issue
Block a user