Skip to content

Commit

Permalink
test same with SNFLK
Browse files Browse the repository at this point in the history
  • Loading branch information
zajca committed Dec 5, 2024
1 parent 2ef55f1 commit 5778684
Showing 1 changed file with 34 additions and 10 deletions.
44 changes: 34 additions & 10 deletions tests/Backend/Snowflake/ImportTreatValuesAsNullTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function testImportTreatValuesAsNull(
return $row;
}, $data);

$this->assertEqualsCanonicalizing($expectedData, $data);
$this->assertArraySameSorted($expectedData, $data, 0);
}

/**
Expand All @@ -66,20 +66,20 @@ public function treatValuesAsNullData(): Generator
'expectedData' => [
0 => [
0 => '30',
1 => 'armenia',
2 => null,
1 => 'armenia with null',
2 => null, // col without enclosure is null by default
3 => 'b',
],
1 => [
0 => '31',
1 => 'belarus',
1 => 'belarus with empty string',
2 => '',
3 => 'b',
3 => 'c',
],
2 => [
0 => '32',
1 => 'malta',
2 => 'a',
2 => 'b',
3 => 'b',
],
],
Expand All @@ -90,24 +90,48 @@ public function treatValuesAsNullData(): Generator
'expectedData' => [
0 => [
0 => '30',
1 => 'armenia',
1 => 'armenia with null',
2 => null,
3 => 'b',
],
1 => [
0 => '31',
1 => 'belarus',
1 => 'belarus with empty string',
2 => null,
3 => 'b',
3 => 'c',
],
2 => [
0 => '32',
1 => 'malta',
2 => 'a',
2 => 'b',
3 => 'b',
],
],
];
yield 'string' => [
'importedFile' => __DIR__ . '/../../_data/languages-empty-string.csv',
'expectedData' => [
0 => [
0 => '30',
1 => 'armenia with null',
2 => null, // col without enclosure is null by default
3 => null,
],
1 => [
0 => '31',
1 => 'belarus with empty string',
2 => '',
3 => 'c',
],
2 => [
0 => '32',
1 => 'malta',
2 => null,
3 => null,
],
],
'treatValuesAsNull' => ['b'],
];
}

private function createTable(string $tableName): string
Expand Down

0 comments on commit 5778684

Please sign in to comment.