Forráskód Böngészése

Merge pull request #22 from stesie/add-test-regression-pr14

Add test for regression pointed out in pull request #14
Patrick Reilly 12 éve
szülő
commit
8bf1b92683
1 módosított fájl, 32 hozzáadás és 0 törlés
  1. 32 0
      tests/context_temp_creation.phpt

+ 32 - 0
tests/context_temp_creation.phpt

@@ -0,0 +1,32 @@
+--TEST--
+Test V8::executeString() : correct temp context construction
+--SKIPIF--
+<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
+--FILE--
+<?php
+
+$v8 = new V8Js();
+
+class Failer {
+    protected $_b = null;
+
+    function call($a) {
+        $this->_b = $a;
+    } 
+
+    function test() {
+        print_r($this->_b);
+    }
+}
+
+$v8->failer = new Failer();
+$v8->executeString('PHP.failer.call({ foo: 23 });');
+$v8->failer->test();
+?>
+===EOF===
+--EXPECT--
+V8Object Object
+(
+    [foo] => 23
+)
+===EOF===