-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added missing tests for parquet rows normalizer (#1054)
- Loading branch information
1 parent
03625a2
commit 965269c
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
...pter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/RowsNormalizerTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Flow\ETL\Adapter\Parquet\Tests\Unit; | ||
|
||
use function Flow\ETL\DSL\{row, rows, schema, str_entry, str_schema}; | ||
use Flow\ETL\Adapter\Parquet\RowsNormalizer; | ||
use Flow\ETL\Exception\CastingException; | ||
use Flow\ETL\PHP\Type\Caster; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
final class RowsNormalizerTest extends TestCase | ||
{ | ||
public function test_casting_error() : void | ||
{ | ||
$this->expectException(CastingException::class); | ||
$this->expectExceptionMessage("Can't cast \"NULL\" into \"string\" type"); | ||
|
||
$rows = rows(row(str_entry('id', null))); | ||
$schema = schema(str_schema('id', nullable: false)); | ||
|
||
(new RowsNormalizer(Caster::default()))->normalize($rows, $schema); | ||
} | ||
} |