mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
N°8796 - Add PHP code style validation in iTop and extensions - format whole code base
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user