N°8796 - Add PHP code style validation in iTop and extensions - format whole code base

This commit is contained in:
odain
2025-11-07 15:39:53 +01:00
parent 12f23113f5
commit 890a2568c8
2110 changed files with 53099 additions and 63885 deletions

View File

@@ -5,7 +5,6 @@ namespace Combodo\iTop\Test\UnitTest\Core;
use Combodo\iTop\Test\UnitTest\ItopTestCase;
use CSVParser;
class CSVParserTest extends ItopTestCase
{
protected function setUp(): void
@@ -36,32 +35,29 @@ a2?;?b?;?c?
?a?;?b?;?ouf !?
spaces trimmed out ; 1234; mac@enroe.com ';
$aExpectedResult = array(
array('line 0, col 0', 'line 0, col 1', 'line 0, col 2'),
array('a', 'b', 'c'),
array('a', 'b', null),
array(' a ', ' b ', ' c '),
array('a', 'b', 'c'),
array('', '', ''),
array('', '', ''),
array('a"', 'b', 'c'),
array("a1\na2", 'b', 'c'),
array('a1,a2', 'b', 'c'),
array('a', 'b', "c1,\",c2\n,c3"),
array('a', 'b', 'ouf !'),
array('spaces trimmed out', '1234', 'mac@enroe.com'),
);
$aExpectedResult = [
['line 0, col 0', 'line 0, col 1', 'line 0, col 2'],
['a', 'b', 'c'],
['a', 'b', null],
[' a ', ' b ', ' c '],
['a', 'b', 'c'],
['', '', ''],
['', '', ''],
['a"', 'b', 'c'],
["a1\na2", 'b', 'c'],
['a1,a2', 'b', 'c'],
['a', 'b', "c1,\",c2\n,c3"],
['a', 'b', 'ouf !'],
['spaces trimmed out', '1234', 'mac@enroe.com'],
];
$oCSVParser = new CSVParser($sDataFile, $sSeparator, $sDelimiter);
$aData = $oCSVParser->ToArray(1, null, 0);
foreach ($aData as $iRow => $aRow)
{
foreach ($aRow as $iCol => $cellValue)
{
foreach ($aData as $iRow => $aRow) {
foreach ($aRow as $iCol => $cellValue) {
$this->assertSame($aExpectedResult[$iRow][$iCol], $cellValue, "Line $iRow, Column $iCol");
}
}
}
}