refactor serde interfaces and impls
[awesomized/ext-ion] / tests / unserialize / invalid_annotation.phpt
1 --TEST--
2 ion\unserialize/invalid annotation
3 --EXTENSIONS--
4 ion
5 --FILE--
6 TEST
7 <?php
8 foreach (["r::r::1", "R::R::1", "p::p::1", "p::foo::p::1", "c::c::1", "c::1", "E::foo::E::1",
9 "E::1", "S::1", "S::S::foo123", "O::O::O::1", "O::1", "C::C::C::1", "C::1"] as $s) {
10 try { var_dump(ion\unserialize($s)); }
11 catch (Throwable $e) { printf("caught %s: %s\n", get_class($e), $e->getMessage()); }
12 }
13 ?>
14 DONE
15 --EXPECTF--
16 TEST
17 caught ion\Exception: Invalid multiple back reference annotations
18 caught ion\Exception: Invalid multiple reference annotations
19 int(1)
20 caught ion\Exception: Invalid multiple object property annotations
21 caught ion\Exception: Invalid object type annotation: c::1
22 caught ion\Exception: IERR_INVALID_ARG: %s
23 caught ion\Exception: Invalid multiple object type annotations: E::E
24 caught ion\Exception: IERR_INVALID_ARG: %s
25 caught ion\Exception: IERR_INVALID_ARG: %s
26 caught ion\Exception: Class S does not implement Serializable
27 caught ion\Exception: Invalid multiple object type annotations: O::O
28 caught ion\Exception: IERR_INVALID_ARG: %s
29 caught ion\Exception: Invalid multiple object type annotations: C::C
30 caught ion\Exception: IERR_INVALID_ARG: %s
31 DONE