Add unit tests for XML migration from 1.8 > 1.7 and 1.7 > 1.6

This commit is contained in:
Molkobain
2020-08-19 11:36:40 +02:00
parent 0a4ce0865e
commit e6bab46854
5 changed files with 53 additions and 2 deletions

View File

@@ -12,4 +12,5 @@
<url>$$http://fr.wikipedia.org/</url>
</menu>
</menus>
<branding/>
</itop_design>

View File

@@ -13,4 +13,13 @@
<url>$$http://fr.wikipedia.org/</url>
</menu>
</menus>
<branding>
<themes>
<theme id="light-grey">
<variables>
<variable id="foo" _delta="define">bar</variable>
</variables>
</theme>
</themes>
</branding>
</itop_design>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.7">
<menus>
<menu id="WelcomeMenuLink1" xsi:type="WebPageMenuNode" _delta="define">
<rank>100</rank>
<parent>WelcomeMenu</parent>
<url>$$http://fr.wikipedia.org/</url>
<in_new_window>true</in_new_window>
</menu>
<menu id="RequestManagement" xsi:type="MenuGroup" _delta="define">
<rank>30</rank>
<enable_stimulus/>
</menu>
</menus>
<branding>
<main_logo _delta="define">images/itop-logo.png</main_logo>
</branding>
</itop_design>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.8">
<menus>
<menu id="WelcomeMenuLink1" xsi:type="WebPageMenuNode" _delta="define">
<rank>100</rank>
<parent>WelcomeMenu</parent>
<url>$$http://fr.wikipedia.org/</url>
<in_new_window>true</in_new_window>
</menu>
<menu id="RequestManagement" xsi:type="MenuGroup" _delta="define">
<rank>30</rank>
<enable_stimulus/>
<style>
<decoration_classes>fas fa-comment-alt</decoration_classes>
</style>
</menu>
</menus>
<branding>
<main_logo _delta="define">images/itop-logo.png</main_logo>
<main_logo_compact _delta="define">images/itop-logo-square.png</main_logo_compact>
</branding>
</itop_design>

View File

@@ -31,7 +31,7 @@ class TestForITopDesignFormatClass extends ItopTestCase
/**
* @covers iTopDesignFormat::Convert
* @dataProvider testMigrationMethodProvider
* @dataProvider MigrationMethodProvider
*
* @param string $sTargetVersion
* @param string $sInputXmlFileName example "1.7_to_1.6.input"
@@ -64,10 +64,11 @@ class TestForITopDesignFormatClass extends ItopTestCase
return file_get_contents($sCurrentPath.DIRECTORY_SEPARATOR.$sFileName.'.xml');
}
public function testMigrationMethodProvider()
public function MigrationMethodProvider()
{
return array(
'1.7 to 1.6' => array('1.6', '1.7_to_1.6.input', '1.7_to_1.6.expected'),
'1.8 to 1.7' => array('1.7', '1.8_to_1.7.input', '1.8_to_1.7.expected'),
);
}
}