serialize_basic.phpt 934 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --TEST--
  2. Test serialize(V8Js) : __sleep and __wakeup throw
  3. --SKIPIF--
  4. <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
  5. --FILE--
  6. <?php
  7. $v8 = new V8Js();
  8. try {
  9. $stored = serialize($v8);
  10. }
  11. catch(\V8JsException $e) {
  12. var_dump(get_class($e));
  13. var_dump($e->getMessage());
  14. }
  15. $stored = 'O:4:"V8Js":0:{}';
  16. try {
  17. $b = unserialize($stored);
  18. }
  19. catch(\V8JsException $e) {
  20. var_dump(get_class($e));
  21. var_dump($e->getMessage());
  22. }
  23. $stored = 'O:4:"V8Js":1:{s:3:"foo";i:23;}';
  24. try {
  25. $b = unserialize($stored);
  26. }
  27. catch(\V8JsException $e) {
  28. var_dump(get_class($e));
  29. var_dump($e->getMessage());
  30. }
  31. ?>
  32. ===EOF===
  33. --EXPECT--
  34. string(13) "V8JsException"
  35. string(50) "You cannot serialize or unserialize V8Js instances"
  36. string(13) "V8JsException"
  37. string(50) "You cannot serialize or unserialize V8Js instances"
  38. string(13) "V8JsException"
  39. string(50) "You cannot serialize or unserialize V8Js instances"
  40. ===EOF===