File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -294,4 +294,26 @@ private function assertJsonEqualsJson($json1, $json2)
294
294
{
295
295
$ this ->assertJsonStringEqualsJsonString ($ json1 , $ json2 );
296
296
}
297
+
298
+ public function testSerialize ()
299
+ {
300
+ // split string for Pretty CI: "Line exceeds 120 characters"
301
+ $ bin = '4f3a33303a224d79434c6162735c54657374735c456e756d5c456e756d4669787 ' .
302
+ '4757265223a313a7b733a383a22002a0076616c7565223b733a333a22666f6f223b7d ' ;
303
+
304
+ $ this ->assertEquals ($ bin , bin2hex (serialize (EnumFixture::FOO ())));
305
+ }
306
+
307
+ public function testUnserialize ()
308
+ {
309
+ // split string for Pretty CI: "Line exceeds 120 characters"
310
+ $ bin = '4f3a33303a224d79434c6162735c54657374735c456e756d5c456e756d4669787 ' .
311
+ '4757265223a313a7b733a383a22002a0076616c7565223b733a333a22666f6f223b7d ' ;
312
+
313
+ /* @var $value EnumFixture */
314
+ $ value = unserialize (pack ('H* ' , $ bin ));
315
+
316
+ $ this ->assertEquals (EnumFixture::FOO , $ value ->getValue ());
317
+ $ this ->assertTrue (EnumFixture::FOO ()->equals ($ value ));
318
+ }
297
319
}
You can’t perform that action at this time.
0 commit comments