From 0598029258fdd0f01461da4493890e57510f6da6 Mon Sep 17 00:00:00 2001 From: liquetsoft Date: Fri, 25 Oct 2024 20:42:13 +0200 Subject: [PATCH] Add test for XML long ints --- src/Serializer/FiasSerializer.php | 6 +++++- tests/MockModel/PipelineTestMockModel.php | 2 ++ tests/Pipeline/InstallPipelineTest.php | 10 ++++++++++ tests/Pipeline/UpdatePipelineTest.php | 4 ++++ tests/Pipeline/_fixtures/install.zip | Bin 577 -> 760 bytes tests/Pipeline/_fixtures/update.zip | Bin 581 -> 769 bytes 6 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/Serializer/FiasSerializer.php b/src/Serializer/FiasSerializer.php index 51606e5..3103231 100644 --- a/src/Serializer/FiasSerializer.php +++ b/src/Serializer/FiasSerializer.php @@ -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(), ]; } diff --git a/tests/MockModel/PipelineTestMockModel.php b/tests/MockModel/PipelineTestMockModel.php index 5a3df1b..cdc2249 100644 --- a/tests/MockModel/PipelineTestMockModel.php +++ b/tests/MockModel/PipelineTestMockModel.php @@ -24,6 +24,7 @@ class PipelineTestMockModel extends Model 'testName', 'startdate', 'uuid', + 'stringCode', ]; protected $casts = [ @@ -31,5 +32,6 @@ class PipelineTestMockModel extends Model 'testName' => 'string', 'startdate' => 'datetime', 'uuid' => 'string', + 'stringCode' => 'string', ]; } diff --git a/tests/Pipeline/InstallPipelineTest.php b/tests/Pipeline/InstallPipelineTest.php index 661631c..c955780 100644 --- a/tests/Pipeline/InstallPipelineTest.php +++ b/tests/Pipeline/InstallPipelineTest.php @@ -63,6 +63,9 @@ protected function setUp(): void 'uuid' => [ 'type' => 'string', ], + 'stringCode' => [ + 'type' => 'string', + ], ] ); @@ -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( @@ -178,6 +182,12 @@ private function createPipeLine(): Pipe 'subType' => 'uuid', ] ), + new BaseEntityField( + [ + 'name' => 'stringCode', + 'type' => 'string', + ] + ), ], ] ), diff --git a/tests/Pipeline/UpdatePipelineTest.php b/tests/Pipeline/UpdatePipelineTest.php index f8cac3e..b70e7ea 100644 --- a/tests/Pipeline/UpdatePipelineTest.php +++ b/tests/Pipeline/UpdatePipelineTest.php @@ -62,6 +62,9 @@ protected function setUp(): void 'uuid' => [ 'type' => 'string', ], + 'stringCode' => [ + 'type' => 'string', + ], ] ); @@ -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( diff --git a/tests/Pipeline/_fixtures/install.zip b/tests/Pipeline/_fixtures/install.zip index 093c70b2a96ff705b82ee6fddf7cb2e19305508e..cc25cebc89844972284a66810502411bedc4130b 100644 GIT binary patch literal 760 zcmWIWW@Zs#-~dADHD-YfP_Pw9OE4%fI0nbNxcbEV`a65a8yFfG8W|WF=tcPYgof}k zu%`uP#e>wBKb1}|t>9*0WO>2NzyKy}{k*vj8Hn7e?)va;qvxz^VZS1|AITI(hQBy9H_ZJe_8!c_2_~wy&l~Ydl}ju3#^fTuY0ECvFMlB$A>>y z?Dm+Q)H2b}>}n|A>YWn(x&aBozcwgr@JLh2)>!IwVwU&B6H6@Cv6!9DyS-TN6!Y;_ z`-)cPob&w@vwD*b*IHMm4QsMD{cpU>AK=Z-k-KWC_f(*pK^_c%d;P?c$ViY+Kp>ov zfk6b~b?n}r3G^-uqj`I3z-cZfL!LdqMHRniU9MfZqw0f7$NvqtG+fKMbHo1B?AERl z&~H;zNu0#F`IgNs={uG#&v#2@t`gi~UHN*KckkXgS7pp!hraf|zPJ0+DhG>G=hSwc zEXd*WJ#E_6eqil>W2Y%<9l0vLy~|pa<}xgqt}O8D-rjGP`lq};))a=M3L*4pT^@V=p) z0p5&EBFu=ifgE(8v;hNK8bK^_Qwp*zplCpL0Vo<^U`yj~ Yh%F>XN`N;j8^{zUAUpx2rI=FdL|Ms+VbkkjDrA8wQtg?x zF9XVIFfuTR0BOhIcwc{K?|1`414APNBLlq%U!SS{zI;s%JZ|6TEqYm3V)ciEB_%g$ z53`f0aI5DGC!2l39x(#uX89M_XMVo4sqVY}jLI+9cttP8DSx=I>l|M{m-^1tJgSQ!QN1^vBAK%Z0~am z&;G8>f0msnnV97iw$bylN@ubx*TW4P-P+8;tSjW6wohep2+{eIxb$e%k9~W8GX!`u zGTAfZ^gPgWAfV8|x}_0F1H&Q$SqHYj0BZp1*wT0!$ix;j0p6@^AXQ92*a4&$1A~!) F0RUL!dpH09 diff --git a/tests/Pipeline/_fixtures/update.zip b/tests/Pipeline/_fixtures/update.zip index 469df5c1563f641f976b42321376916ea85358e1..4d09ac3adcc431aa22e547f8531ab33e533f1f95 100644 GIT binary patch literal 769 zcmWIWW@Zs#-~hsB8_WV3pkOPImS9j|a14%jarKG!^>_A;H!w6XG%_$U(2MZ(2@T<8 zU@wTwiU+CR_f$H)w1S&~k>v$50|S__?Q`ThWFX@5eV)>v+MG$tu6kWw$NG_P<4>;( zCKvvQy?=H{xsuhH^`UMWTieX@ukU_4{~>|f@8t1|4R^Q_Ech<|{Fs)oO#8m`{jG|8 z-zWQj3GOktcv12~)ZwgiW(yd*at;ZIvrIeT_eAGu2 zUNKva$45!9A7OnxJvDlp{ps0n^S>`%H>aqhmf6HP;LiL-{C{^gI_~=_v~B)uy?J`= z6P}7`KGdnc->_9|*^||8cQAHp6^gIt(ej>sWP8vmw#=oR-69XGgjOVSq|Q6jw03pY z+0$18Cx7I=J1r(UIP_d(cL%FM{UWR9^HwZ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