Skip to content

Commit 0598029

Browse files
committed
Add test for XML long ints
1 parent 63591fb commit 0598029

File tree

6 files changed

+21
-1
lines changed

6 files changed

+21
-1
lines changed

src/Serializer/FiasSerializer.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ public function __construct(?array $normalizers = null, ?array $encoders = null)
5959

6060
if ($encoders === null) {
6161
$encoders = [
62-
new XmlEncoder(),
62+
new XmlEncoder(
63+
[
64+
XmlEncoder::TYPE_CAST_ATTRIBUTES => false,
65+
]
66+
),
6367
new JsonEncoder(),
6468
];
6569
}

tests/MockModel/PipelineTestMockModel.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ class PipelineTestMockModel extends Model
2424
'testName',
2525
'startdate',
2626
'uuid',
27+
'stringCode',
2728
];
2829

2930
protected $casts = [
3031
'testId' => 'integer',
3132
'testName' => 'string',
3233
'startdate' => 'datetime',
3334
'uuid' => 'string',
35+
'stringCode' => 'string',
3436
];
3537
}

tests/Pipeline/InstallPipelineTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ protected function setUp(): void
6363
'uuid' => [
6464
'type' => 'string',
6565
],
66+
'stringCode' => [
67+
'type' => 'string',
68+
],
6669
]
6770
);
6871

@@ -127,6 +130,7 @@ public function testInstall(): void
127130
'testName' => 'to insert',
128131
'startDate' => new \DateTimeImmutable('2019-11-11 11:11:11'),
129132
'uuid' => '123e4567-e89b-12d3-a456-426655440001',
133+
'stringCode' => '227010000010000016740025000000000',
130134
]
131135
);
132136
$this->assertDatabaseDoesNotHaveRow(
@@ -178,6 +182,12 @@ private function createPipeLine(): Pipe
178182
'subType' => 'uuid',
179183
]
180184
),
185+
new BaseEntityField(
186+
[
187+
'name' => 'stringCode',
188+
'type' => 'string',
189+
]
190+
),
181191
],
182192
]
183193
),

tests/Pipeline/UpdatePipelineTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ protected function setUp(): void
6262
'uuid' => [
6363
'type' => 'string',
6464
],
65+
'stringCode' => [
66+
'type' => 'string',
67+
],
6568
]
6669
);
6770

@@ -126,6 +129,7 @@ public function testUpdate(): void
126129
'testName' => 'to insert',
127130
'startDate' => new \DateTimeImmutable('2019-11-11 11:11:11'),
128131
'uuid' => '123e4567-e89b-12d3-a456-426655440005',
132+
'stringCode' => '227010000010000016740025000000000',
129133
]
130134
);
131135
$this->assertDatabaseDoesNotHaveRow(

tests/Pipeline/_fixtures/install.zip

183 Bytes
Binary file not shown.

tests/Pipeline/_fixtures/update.zip

188 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)