Merge branch 'support/3.2' into develop

This commit is contained in:
odain
2025-11-07 20:33:14 +01:00
1837 changed files with 33034 additions and 34549 deletions

View File

@@ -10,7 +10,6 @@ use MFElement;
use ModelFactory;
use PHPUnit\Framework\ExpectationFailedException;
/**
* Class ModelFactoryTest
*
@@ -681,8 +680,7 @@ class ModelFactoryTest extends ItopTestCase
$oDeltaRoot = $oDocument->firstChild;
try {
$oFactory->LoadDelta($oDeltaRoot, $oFactoryDocument);
}
catch (\Exception $e) {
} catch (\Exception $e) {
$this->assertNull($sExpectedXML, 'LoadDelta() should not have failed with exception: '.$e->getMessage());
$this->assertEquals($sExpectedXMLOrErrorMessage, $e->getMessage());
return;
@@ -2224,7 +2222,9 @@ XML
*/
public function AlterationAPIsProvider()
{
define('CASE_NO_FLAG', <<<XML
define(
'CASE_NO_FLAG',
<<<XML
<root_tag>
<container_tag>
<target_tag/>
@@ -2232,7 +2232,9 @@ XML
</root_tag>
XML
);
define('CASE_ABOVE_A_FLAG', <<<XML
define(
'CASE_ABOVE_A_FLAG',
<<<XML
<root_tag>
<container_tag>
<target_tag>
@@ -2242,7 +2244,9 @@ XML
</root_tag>
XML
);
define('CASE_IN_A_DEFINITION', <<<XML
define(
'CASE_IN_A_DEFINITION',
<<<XML
<root_tag>
<container_tag _alteration="added">
<target_tag>
@@ -2252,7 +2256,9 @@ XML
</root_tag>
XML
);
define('CASE_FLAG_ON_TARGET_define', <<<XML
define(
'CASE_FLAG_ON_TARGET_define',
<<<XML
<root_tag>
<container_tag>
<target_tag _alteration="added"/>
@@ -2260,7 +2266,9 @@ XML
</root_tag>
XML
);
define('CASE_FLAG_ON_TARGET_redefine', <<<XML
define(
'CASE_FLAG_ON_TARGET_redefine',
<<<XML
<root_tag>
<container_tag>
<target_tag _alteration="replaced"/>
@@ -2268,7 +2276,9 @@ XML
</root_tag>
XML
);
define('CASE_FLAG_ON_TARGET_needed', <<<XML
define(
'CASE_FLAG_ON_TARGET_needed',
<<<XML
<root_tag>
<container_tag>
<target_tag _alteration="needed"/>
@@ -2276,7 +2286,9 @@ XML
</root_tag>
XML
);
define('CASE_FLAG_ON_TARGET_forced', <<<XML
define(
'CASE_FLAG_ON_TARGET_forced',
<<<XML
<root_tag>
<container_tag>
<target_tag _alteration="forced"/>
@@ -2284,7 +2296,9 @@ XML
</root_tag>
XML
);
define('CASE_FLAG_ON_TARGET_removed', <<<XML
define(
'CASE_FLAG_ON_TARGET_removed',
<<<XML
<root_tag>
<container_tag>
<target_tag _alteration="removed"/>
@@ -2292,7 +2306,9 @@ XML
</root_tag>
XML
);
define('CASE_FLAG_ON_TARGET_old_id', <<<XML
define(
'CASE_FLAG_ON_TARGET_old_id',
<<<XML
<root_tag>
<container_tag>
<target_tag id="fraise" _old_id="tagada"/>
@@ -2300,7 +2316,9 @@ XML
</root_tag>
XML
);
define('CASE_MISSING_TARGET', <<<XML
define(
'CASE_MISSING_TARGET',
<<<XML
<root_tag>
<container_tag/>
</root_tag>
@@ -3088,7 +3106,7 @@ XML
$oNode->setAttribute('id', $sClassName);
$oNode->setAttribute('_created_in', $sModuleName);
$oDoc = $oNode->ownerDocument;
foreach (array('properties', 'fields', 'methods', 'presentation') as $sElementName) {
foreach (['properties', 'fields', 'methods', 'presentation'] as $sElementName) {
$oElement = $oDoc->createElement($sElementName);
$oNode->appendChild($oElement);
}
@@ -3203,7 +3221,6 @@ XML
$this->assertCount(0, $aDiff);
}
/**
* @test
* @dataProvider AddClassProvider
@@ -3445,11 +3462,9 @@ XML
$oFactory->LoadDelta($oDeltaRoot, $oFactoryDocument, ModelFactory::LOAD_DELTA_MODE_LAX);
$this->assertNotNull($sExpectedXML, "LoadDelta(lax) should have failed with exception: $sExpectedXMLInLaxMode");
$this->AssertEqualModels($sExpectedXML, $oFactory, 'LoadDelta(lax) did not produce the expected result');
}
catch (ExpectationFailedException $e) {
} catch (ExpectationFailedException $e) {
throw $e;
}
catch (\Exception $e) {
} catch (\Exception $e) {
$this->assertNull($sExpectedXML, 'LoadDelta(lax) should not have failed with exception: '.$e->getMessage());
$this->assertEquals($sExpectedXMLInLaxMode, $e->getMessage());
}
@@ -3470,11 +3485,9 @@ XML
$oFactory->LoadDelta($oDeltaRoot, $oFactoryDocument, ModelFactory::LOAD_DELTA_MODE_STRICT);
$this->assertNotNull($sExpectedXML, "LoadDelta(lax) should have failed with exception: $sExpectedXMLInStrictMode");
$this->AssertEqualModels($sExpectedXML, $oFactory, 'LoadDelta(strict) did not produce the expected result');
}
catch (ExpectationFailedException $e) {
} catch (ExpectationFailedException $e) {
throw $e;
}
catch (\Exception $e) {
} catch (\Exception $e) {
$this->assertNull($sExpectedXML, 'LoadDelta(strict) should not have failed with exception: '.$e->getMessage());
$this->assertEquals($sExpectedXMLInStrictMode, $e->getMessage());
}
@@ -3694,10 +3707,12 @@ XML
];
}
public function testDictEntryIsIntegratedIntoMF() {
public function testDictEntryIsIntegratedIntoMF()
{
$oFactory = new ModelFactory([]);
$sLanguageCode = 'RU URSS';
$oFactory->IntegrateDictEntriesIntoXML($sLanguageCode,
$oFactory->IntegrateDictEntriesIntoXML(
$sLanguageCode,
[
'english_description' => 'Russian',
'localized_description' => 'URSS',
@@ -3708,7 +3723,8 @@ XML
);
$this->assertDictEntryUniqueAndEquals($oFactory, $sLanguageCode, 'key1', 'Label 1', 'New entry in new language should be present in XML');
$oFactory->IntegrateDictEntriesIntoXML($sLanguageCode,
$oFactory->IntegrateDictEntriesIntoXML(
$sLanguageCode,
[
'english_description' => 'Russian',
'localized_description' => 'URSS',