diff --git a/tests/has_property_after_dispose.phpt b/tests/has_property_after_dispose.phpt new file mode 100644 index 0000000..7c0ea3c --- /dev/null +++ b/tests/has_property_after_dispose.phpt @@ -0,0 +1,38 @@ +--TEST-- +Test V8::executeString() : has_property after dispose +--SKIPIF-- + +--FILE-- +x = $x; + } +} + +$v8 = new V8Js(); +$v8->foo = $foo = new Foo(); + +$JS = <<< EOT +PHP.foo.callMe({ bla: 23 }); + +EOT; + +$v8->executeString($JS, 'basic.js'); +unset($v8); + +try { + var_dump(property_exists($foo->x, 'bla')); +} +catch(V8JsScriptException $e) { + var_dump($e->getMessage()); +} +?> +===EOF=== +--EXPECTF-- +bool(true) +string(55) "Can't access V8Object after V8Js instance is destroyed!" +===EOF=== +