Skip to content

Commit

Permalink
Add test for XML long ints (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
liquetsoft authored Oct 25, 2024
1 parent 63591fb commit 82a8c4b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Serializer/FiasSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ public function __construct(?array $normalizers = null, ?array $encoders = null)

if ($encoders === null) {
$encoders = [
new XmlEncoder(),
new XmlEncoder(
[
XmlEncoder::TYPE_CAST_ATTRIBUTES => false,
]
),
new JsonEncoder(),
];
}
Expand Down
2 changes: 2 additions & 0 deletions tests/MockModel/PipelineTestMockModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ class PipelineTestMockModel extends Model
'testName',
'startdate',
'uuid',
'stringCode',
];

protected $casts = [
'testId' => 'integer',
'testName' => 'string',
'startdate' => 'datetime',
'uuid' => 'string',
'stringCode' => 'string',
];
}
10 changes: 10 additions & 0 deletions tests/Pipeline/InstallPipelineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ protected function setUp(): void
'uuid' => [
'type' => 'string',
],
'stringCode' => [
'type' => 'string',
],
]
);

Expand Down Expand Up @@ -127,6 +130,7 @@ public function testInstall(): void
'testName' => 'to insert',
'startDate' => new \DateTimeImmutable('2019-11-11 11:11:11'),
'uuid' => '123e4567-e89b-12d3-a456-426655440001',
'stringCode' => '227010000010000016740025000000000',
]
);
$this->assertDatabaseDoesNotHaveRow(
Expand Down Expand Up @@ -178,6 +182,12 @@ private function createPipeLine(): Pipe
'subType' => 'uuid',
]
),
new BaseEntityField(
[
'name' => 'stringCode',
'type' => 'string',
]
),
],
]
),
Expand Down
4 changes: 4 additions & 0 deletions tests/Pipeline/UpdatePipelineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ protected function setUp(): void
'uuid' => [
'type' => 'string',
],
'stringCode' => [
'type' => 'string',
],
]
);

Expand Down Expand Up @@ -126,6 +129,7 @@ public function testUpdate(): void
'testName' => 'to insert',
'startDate' => new \DateTimeImmutable('2019-11-11 11:11:11'),
'uuid' => '123e4567-e89b-12d3-a456-426655440005',
'stringCode' => '227010000010000016740025000000000',
]
);
$this->assertDatabaseDoesNotHaveRow(
Expand Down
Binary file modified tests/Pipeline/_fixtures/install.zip
Binary file not shown.
Binary file modified tests/Pipeline/_fixtures/update.zip
Binary file not shown.

0 comments on commit 82a8c4b

Please sign in to comment.