N°4569 - Fix unit tests

This commit is contained in:
Eric Espie
2022-01-26 15:30:03 +01:00
parent a839b1c4ae
commit 9a6d40e9db
3 changed files with 13 additions and 10 deletions

View File

@@ -16,15 +16,15 @@
</constants>
<meta>
<previous_versions>
<previous_version id="1.6" _delta="define">
<previous_version id="1.6">
<trashed_nodes>
<trashed_node id="1">
<trashed_node id="XXX" _delta="define">
<parent_xpath>/itop_design/constants</parent_xpath>
<node_tree>
<constant id="PORTAL_SERVICECATEGORY_QUERY" xsi:type="string" _created_in="itop-tickets" _revision_id="19" _disabled_delta="redefine"><![CDATA[SELECT s FROM Organization AS child JOIN Organization AS root ON child.parent_id BELOW root.id JOIN CustomerContract AS cc ON cc.org_id = root.id JOIN lnkCustomerContractToService AS l1 ON l1.customercontract_id=cc.id JOIN Service AS s ON l1.service_id=s.id WHERE child.id = :org_id AND s.status != 'obsolete' UNION SELECT Service AS s JOIN lnkCustomerContractToService AS l1 ON l1.service_id=s.id JOIN CustomerContract AS cc ON l1.customercontract_id=cc.id WHERE cc.org_id = :org_id AND s.status != 'obsolete']]></constant>
</node_tree>
</trashed_node>
<trashed_node id="2">
<trashed_node id="XXX" _delta="define">
<parent_xpath>/itop_design/constants</parent_xpath>
<node_tree>
<constant id="PORTAL_VALIDATE_SERVICECATEGORY_QUERY" xsi:type="string" _created_in="itop-tickets" _revision_id="19" _disabled_delta="redefine"><![CDATA[SELECT s FROM Organization AS child JOIN Organization AS root ON child.parent_id BELOW root.id JOIN CustomerContract AS cc ON cc.org_id = root.id JOIN lnkCustomerContractToService AS l1 ON l1.customercontract_id=cc.id JOIN Service AS s ON l1.service_id=s.id WHERE child.id = :org_id AND s.id = :id AND s.status != 'obsolete' UNION SELECT Service AS s JOIN lnkCustomerContractToService AS l1 ON l1.service_id=s.id JOIN CustomerContract AS cc ON l1.customercontract_id=cc.id WHERE cc.org_id = :org_id AND s.id = :id AND s.status != 'obsolete']]></constant>

View File

@@ -108,9 +108,9 @@
</classes>
<meta>
<previous_versions>
<previous_version id="1.7" _delta="define">
<previous_version id="1.7">
<trashed_nodes>
<trashed_node id="1">
<trashed_node id="XXX" _delta="define">
<parent_xpath>/itop_design/branding/themes</parent_xpath>
<node_tree>
<theme id="light-grey">
@@ -125,19 +125,19 @@
</theme>
</node_tree>
</trashed_node>
<trashed_node id="2">
<trashed_node id="XXX" _delta="define">
<parent_xpath>/itop_design/branding/themes/theme[@id="test-red"]/imports</parent_xpath>
<node_tree>
<import id="css-variables">../css/css-variables.scss</import>
</node_tree>
</trashed_node>
<trashed_node id="3">
<trashed_node id="XXX" _delta="define">
<parent_xpath>/itop_design/branding/themes/theme[@id="test-red"]/stylesheets</parent_xpath>
<node_tree>
<stylesheet id="jqueryui">../css/ui-lightness/jqueryui.scss</stylesheet>
</node_tree>
</trashed_node>
<trashed_node id="4">
<trashed_node id="XXX" _delta="define">
<parent_xpath>/itop_design/branding/themes/theme[@id="test-red"]/stylesheets</parent_xpath>
<node_tree>
<stylesheet id="main">../css/main.scss</stylesheet>

View File

@@ -50,16 +50,19 @@ class TestForITopDesignFormatClass extends ItopTestCase
$oDesignFormat->Convert($sTargetVersion);
$sConvertedXml = $oInputDocument->saveXML();
// Erase dynamic values
$sConvertedXml = preg_replace('@<trashed_node id="\w+"@', '<trashed_node id="XXX"', $sConvertedXml);
$this->assertEquals($sExpectedXml, $sConvertedXml);
}
public function ConvertProvider()
{
return array(
//'1.6 to 1.7 acl' => array('1.7', '1.6_to_1.7_acl'),
'1.6 to 1.7 acl' => array('1.7', '1.6_to_1.7_acl'),
'1.7 to 1.6 acl' => array('1.6', '1.7_to_1.6_acl'),
'1.7 to 1.6' => array('1.6', '1.7_to_1.6'),
//'1.7 to 3.0' => array('3.0', '1.7_to_3.0'),
'1.7 to 3.0' => array('3.0', '1.7_to_3.0'),
'3.0 to 1.7' => array('1.7', '3.0_to_1.7'),
'3.0 to 1.7 no previous' => array('1.7', '3.0_to_1.7_no_previous'),
);