浏览代码

Add test on protected & private properties on derived classes

Stefan Siegl 11 年之前
父节点
当前提交
b888cfce0d
共有 1 个文件被更改,包括 27 次插入0 次删除
  1. 27 0
      tests/derived_class_properties_protected.phpt

+ 27 - 0
tests/derived_class_properties_protected.phpt

@@ -0,0 +1,27 @@
+--TEST--
+Test V8::executeString() : Protected and private properties on derived class
+--SKIPIF--
+<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
+--FILE--
+<?php
+
+class V8Wrapper extends V8Js {
+    protected $testing;
+    private $privTesting;
+
+    public function __construct() {
+        parent::__construct();
+        $this->testing = 23;
+        $this->privTesting = 42;
+    }
+}
+
+$v8 = new V8Wrapper();
+$v8->executeString('print(PHP.testing + "\n");');
+$v8->executeString('print(PHP.privTesting + "\n");');
+?>
+===EOF===
+--EXPECT--
+undefined
+undefined
+===EOF===