mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 16:24:04 +02:00
Remove unused unit tests for extending sections
This commit is contained in:
parent
28e1b3119c
commit
bc14e227ec
@ -300,220 +300,6 @@ EOD
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testWhetherSimplePropertiesOfExtendingSectionsAreInserted()
|
|
||||||
{
|
|
||||||
$this->markTestSkipped(
|
|
||||||
'Implementation has changed. There is no "Extend" functionality anymore in our Config object'
|
|
||||||
);
|
|
||||||
$target = $this->writeConfigToTemporaryFile('');
|
|
||||||
$config = Config::fromArray(
|
|
||||||
array(
|
|
||||||
'foo' => array('key1' => '1'),
|
|
||||||
'bar' => array('key2' => '2')
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$config->setExtend('bar', 'foo');
|
|
||||||
$writer = new IniWriter(array('config' => $config, 'filename' => $target));
|
|
||||||
$writer->write();
|
|
||||||
|
|
||||||
$newConfig = Config::fromIni($target);
|
|
||||||
$this->assertInstanceOf(
|
|
||||||
get_class($newConfig),
|
|
||||||
$newConfig->get('foo'),
|
|
||||||
'IniWriter does not insert extended sections'
|
|
||||||
);
|
|
||||||
$this->assertInstanceOf(
|
|
||||||
get_class($newConfig),
|
|
||||||
$newConfig->get('bar'),
|
|
||||||
'IniWriter does not insert extending sections'
|
|
||||||
);
|
|
||||||
$this->assertEquals(
|
|
||||||
'2',
|
|
||||||
$newConfig->get('bar')->get('key2'),
|
|
||||||
'IniWriter does not insert simple properties into extending sections'
|
|
||||||
);
|
|
||||||
$this->assertEquals(
|
|
||||||
'1',
|
|
||||||
$newConfig->get('foo')->get('key1'),
|
|
||||||
'IniWriter does not properly define extending sections'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @depends testWhetherSimplePropertiesOfExtendingSectionsAreInserted
|
|
||||||
*/
|
|
||||||
public function testWhetherSimplePropertiesOfExtendingSectionsAreUpdated()
|
|
||||||
{
|
|
||||||
$this->markTestSkipped(
|
|
||||||
'Implementation has changed. There is no "Extend" functionality anymore in our Config object'
|
|
||||||
);
|
|
||||||
$target = $this->writeConfigToTemporaryFile(<<<'EOD'
|
|
||||||
[foo]
|
|
||||||
key1 = "1"
|
|
||||||
|
|
||||||
[bar : foo]
|
|
||||||
key2 = "2"
|
|
||||||
EOD
|
|
||||||
);
|
|
||||||
$config = Config::fromArray(
|
|
||||||
array(
|
|
||||||
'foo' => array('key1' => '1'),
|
|
||||||
'bar' => array('key2' => '22')
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$config->setExtend('bar', 'foo');
|
|
||||||
$writer = new IniWriter(array('config' => $config, 'filename' => $target));
|
|
||||||
$writer->write();
|
|
||||||
|
|
||||||
$newConfig = Config::fromIni($target);
|
|
||||||
$this->assertEquals(
|
|
||||||
'22',
|
|
||||||
$newConfig->get('bar')->get('key2'),
|
|
||||||
'IniWriter does not update simple properties of extending sections'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @depends testWhetherSimplePropertiesOfExtendingSectionsAreInserted
|
|
||||||
*/
|
|
||||||
public function testWhetherSimplePropertiesOfExtendingSectionsAreDeleted()
|
|
||||||
{
|
|
||||||
$this->markTestSkipped(
|
|
||||||
'Implementation has changed. There is no "Extend" functionality anymore in our Config object'
|
|
||||||
);
|
|
||||||
$target = $this->writeConfigToTemporaryFile(<<<'EOD'
|
|
||||||
[foo]
|
|
||||||
key1 = "1"
|
|
||||||
|
|
||||||
[bar : foo]
|
|
||||||
key2 = "2"
|
|
||||||
EOD
|
|
||||||
);
|
|
||||||
$config = Config::fromArray(
|
|
||||||
array(
|
|
||||||
'foo' => array('key1' => '1'),
|
|
||||||
'bar' => array()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$config->setExtend('bar', 'foo');
|
|
||||||
$writer = new IniWriter(array('config' => $config, 'filename' => $target));
|
|
||||||
$writer->write();
|
|
||||||
|
|
||||||
$newConfig = Config::fromIni($target);
|
|
||||||
$this->assertNull(
|
|
||||||
$newConfig->get('bar')->get('key2'),
|
|
||||||
'IniWriter does not delete simple properties of extending sections'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testWhetherNestedPropertiesOfExtendingSectionsAreInserted()
|
|
||||||
{
|
|
||||||
$this->markTestSkipped(
|
|
||||||
'Implementation has changed. There is no "Extend" functionality anymore in our Config object'
|
|
||||||
);
|
|
||||||
$target = $this->writeConfigToTemporaryFile('');
|
|
||||||
$config = Config::fromArray(
|
|
||||||
array(
|
|
||||||
'foo' => array('a' => array('b' => 'c')),
|
|
||||||
'bar' => array('d' => array('e' => 'f'))
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$config->setExtend('bar', 'foo');
|
|
||||||
$writer = new IniWriter(array('config' => $config, 'filename' => $target));
|
|
||||||
$writer->write();
|
|
||||||
|
|
||||||
$newConfig = Config::fromIni($target);
|
|
||||||
$this->assertInstanceOf(
|
|
||||||
get_class($newConfig),
|
|
||||||
$newConfig->get('foo'),
|
|
||||||
'IniWriter does not insert extended sections'
|
|
||||||
);
|
|
||||||
$this->assertInstanceOf(
|
|
||||||
get_class($newConfig),
|
|
||||||
$newConfig->get('bar'),
|
|
||||||
'IniWriter does not insert extending sections'
|
|
||||||
);
|
|
||||||
$this->assertInstanceOf(
|
|
||||||
get_class($newConfig),
|
|
||||||
$newConfig->get('bar')->get('d'),
|
|
||||||
'IniWriter does not insert nested properties into extending sections'
|
|
||||||
);
|
|
||||||
$this->assertEquals(
|
|
||||||
'f',
|
|
||||||
$newConfig->get('bar')->get('d')->get('e'),
|
|
||||||
'IniWriter does not insert nested properties into extending sections'
|
|
||||||
);
|
|
||||||
$this->assertEquals(
|
|
||||||
'c',
|
|
||||||
$newConfig->get('bar')->get('a')->get('b'),
|
|
||||||
'IniWriter does not properly define extending sections with nested properties'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @depends testWhetherNestedPropertiesOfExtendingSectionsAreInserted
|
|
||||||
*/
|
|
||||||
public function testWhetherNestedPropertiesOfExtendingSectionsAreUpdated()
|
|
||||||
{
|
|
||||||
$target = $this->writeConfigToTemporaryFile(<<<'EOD'
|
|
||||||
[foo]
|
|
||||||
a.b = "c"
|
|
||||||
|
|
||||||
[bar : foo]
|
|
||||||
d.e = "f"
|
|
||||||
EOD
|
|
||||||
);
|
|
||||||
$config = Config::fromArray(
|
|
||||||
array(
|
|
||||||
'foo' => array('a' => array('b' => 'c')),
|
|
||||||
'bar' => array('d' => array('e' => 'ff'))
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$config->setExtend('bar', 'foo');
|
|
||||||
$writer = new IniWriter(array('config' => $config, 'filename' => $target));
|
|
||||||
$writer->write();
|
|
||||||
|
|
||||||
$newConfig = Config::fromIni($target);
|
|
||||||
$this->assertEquals(
|
|
||||||
'ff',
|
|
||||||
$newConfig->get('bar')->get('d')->get('e'),
|
|
||||||
'IniWriter does not update nested properties of extending sections'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @depends testWhetherNestedPropertiesOfExtendingSectionsAreInserted
|
|
||||||
*/
|
|
||||||
public function testWhetherNestedPropertiesOfExtendingSectionsAreDeleted()
|
|
||||||
{
|
|
||||||
$this->markTestSkipped(
|
|
||||||
'Implementation has changed. There is no "Extend" functionality anymore in our Config object'
|
|
||||||
);
|
|
||||||
$target = $this->writeConfigToTemporaryFile(<<<'EOD'
|
|
||||||
[foo]
|
|
||||||
a.b = "c"
|
|
||||||
|
|
||||||
[bar : foo]
|
|
||||||
d.e = "f"
|
|
||||||
EOD
|
|
||||||
);
|
|
||||||
$config = Config::fromArray(
|
|
||||||
array(
|
|
||||||
'foo' => array('a' => array('b' => 'c')),
|
|
||||||
'bar' => array()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$config->setExtend('bar', 'foo');
|
|
||||||
$writer = new IniWriter(array('config' => $config, 'filename' => $target));
|
|
||||||
$writer->write();
|
|
||||||
|
|
||||||
$newConfig = Config::fromIni($target);
|
|
||||||
$this->assertNull(
|
|
||||||
$newConfig->get('bar')->get('d'),
|
|
||||||
'IniWriter does not delete nested properties of extending sections'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testWhetherSectionOrderIsUpdated()
|
public function testWhetherSectionOrderIsUpdated()
|
||||||
{
|
{
|
||||||
$config = <<<'EOD'
|
$config = <<<'EOD'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user