mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
fix ci
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -148,9 +148,10 @@ class ThemeHandlerTest extends ItopTestCase
|
||||
|
||||
if ($sPreCompiledSig !== $compiled_json_sig)
|
||||
{
|
||||
$sSignatureDiffToPrint = $this->KeepSignatureDiff($sPreCompiledSig, $compiled_json_sig);
|
||||
var_dump($sSignatureDiffToPrint);
|
||||
$iLine = $oTheme->GetLineNo();
|
||||
$aErrors[] = " $sPrecompiledStylesheetUri declared in $sXmlDataCustoFilePath:$iLine.";
|
||||
$this->assertEquals($sPreCompiledSig, $compiled_json_sig, " $sPrecompiledStylesheetUri declared in $sXmlDataCustoFilePath:$iLine.");
|
||||
$aErrors[] = " $sPrecompiledStylesheetUri declared in $sXmlDataCustoFilePath:$iLine.\n$sSignatureDiffToPrint";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -170,6 +171,42 @@ class ThemeHandlerTest extends ItopTestCase
|
||||
}
|
||||
}
|
||||
|
||||
function KeepSignatureDiff($sSignature1, $sSignature2) : string {
|
||||
$aSignature1 = json_decode($sSignature1, true);
|
||||
$aSignature2 = json_decode($sSignature2, true);
|
||||
|
||||
$aDiffOuput = [];
|
||||
foreach ($aSignature1 as $sKey => $oVal1){
|
||||
if (is_array($oVal1) && ! empty($oVal1)){
|
||||
$aCurrentDiffVal = [];
|
||||
$oVal2 = $aSignature2[$sKey];
|
||||
if (0 != sizeof($oVal1)){
|
||||
foreach ($oVal1 as $sKey1 => $sVal1){
|
||||
if (! array_key_exists($sKey1, $oVal2)){
|
||||
$aCurrentDiffVal[$sKey1] = "Missing";
|
||||
} else if ($sVal1 !== $oVal2[$sKey1]) {
|
||||
$aCurrentDiffVal[$sKey1] = "expected:$sVal1 | actual:" . $oVal2[$sKey1];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (! empty($oVal2)){
|
||||
foreach ($oVal2 as $sKey2 => $sVal2){
|
||||
if (! array_key_exists($sKey2, $oVal1)){
|
||||
$aCurrentDiffVal[$sKey1] = "Missing";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (! empty($aCurrentDiffVal)){
|
||||
$aDiffOuput[$sKey] = $aCurrentDiffVal;
|
||||
}
|
||||
} else if ($oVal1 !== $aSignature2[$sKey]){
|
||||
$aDiffOuput[$sKey] = "expected:$oVal1 | actual:$aSignature2[$sKey]";
|
||||
}
|
||||
}
|
||||
|
||||
return json_encode($aDiffOuput, true);
|
||||
}
|
||||
|
||||
function recurseMkdir($dir)
|
||||
{
|
||||
if (is_dir($dir))
|
||||
|
||||
Reference in New Issue
Block a user