瀏覽代碼

Add test that V8Js::__sleep and V8Js::__wakeup are final

Stefan Siegl 9 年之前
父節點
當前提交
4a8a8b812f
共有 2 個文件被更改,包括 38 次插入0 次删除
  1. 19 0
      tests/issue_183_005.phpt
  2. 19 0
      tests/issue_183_006.phpt

+ 19 - 0
tests/issue_183_005.phpt

@@ -0,0 +1,19 @@
+--TEST--
+Test V8::executeString() : Method access on derived classes (__sleep)
+--SKIPIF--
+<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
+--FILE--
+<?php
+
+class Foo extends \V8Js
+{
+    public function __sleep()
+    {
+	var_dump("foo");
+    }
+}
+
+?>
+===EOF===
+--EXPECTF--
+Fatal error: Cannot override final method V8Js::__sleep() in %s

+ 19 - 0
tests/issue_183_006.phpt

@@ -0,0 +1,19 @@
+--TEST--
+Test V8::executeString() : Method access on derived classes (__wakeup)
+--SKIPIF--
+<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
+--FILE--
+<?php
+
+class Foo extends \V8Js
+{
+    public function __wakeup()
+    {
+	var_dump("foo");
+    }
+}
+
+?>
+===EOF===
+--EXPECTF--
+Fatal error: Cannot override final method V8Js::__wakeup() in %s