X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2FSymbol.phpt;h=92e1dfe9c34d56e6f0cbb6abafd31c3f19be1ab5;hb=bc0258712bc0ec0a6ce5862a3b36fe894c43cd66;hp=7c0adaa67207cb7e66c07074d034633832a0018c;hpb=276e3951449b3c4a77ad843372de4e3b1f80b6e2;p=awesomized%2Fext-ion diff --git a/tests/Symbol.phpt b/tests/Symbol.phpt index 7c0adaa..92e1dfe 100644 --- a/tests/Symbol.phpt +++ b/tests/Symbol.phpt @@ -18,6 +18,12 @@ var_dump($s=new Symbol("s"), (string)$s, $s->sid); var_dump($s=new Symbol("s", 1), (string)$s, $s->sid); var_dump($s=new Symbol(1, 2), (string)$s, $s->sid); +var_dump(ion\unserialize(ion\serialize(clone new ion\Symbol("sym")))); +try { + var_dump(ion\unserialize(ion\serialize(clone new ion\Symbol(null, 123)))); +} catch (Throwable $e) { + printf("caught %s: %s\n", get_class($e), $e->getMessage()); +} ?> DONE --EXPECTF-- @@ -70,4 +76,13 @@ object(ion\Symbol)#%d (3) { } string(1) "1" int(2) +object(ion\Symbol)#%d (3) { + ["value"]=> + string(3) "sym" + ["sid"]=> + int(-1) + ["importLocation"]=> + NULL +} +caught ion\Exception: IERR_INVALID_SYMBOL: %s DONE