mirror of
https://github.com/phpv8/v8js.git
synced 2024-12-22 09:21:52 +00:00
Add test on initially initialized properties on V8Js object.
This commit is contained in:
parent
645b0df999
commit
1f8b605585
26
tests/derived_class_properties_init.phpt
Normal file
26
tests/derived_class_properties_init.phpt
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
--TEST--
|
||||||
|
Test V8::executeString() : Initialized properties on derived class
|
||||||
|
--SKIPIF--
|
||||||
|
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class V8Wrapper extends V8Js {
|
||||||
|
public $testing = 23;
|
||||||
|
protected $protectedVar = 42;
|
||||||
|
private $privateVar = 42;
|
||||||
|
}
|
||||||
|
|
||||||
|
$v8 = new V8Wrapper();
|
||||||
|
echo($v8->testing."\n");
|
||||||
|
$v8->executeString('print(PHP.testing + "\n");');
|
||||||
|
$v8->executeString('print(PHP.protectedVar + "\n");');
|
||||||
|
$v8->executeString('print(PHP.privateVar + "\n");');
|
||||||
|
?>
|
||||||
|
===EOF===
|
||||||
|
--EXPECT--
|
||||||
|
23
|
||||||
|
23
|
||||||
|
undefined
|
||||||
|
undefined
|
||||||
|
===EOF===
|
Loading…
Reference in New Issue
Block a user