summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-09-30 13:49:23 -0700
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-09-30 13:49:23 -0700
commit777eb276f635c949ccdcf9613ad55d42190cb387 (patch)
treef5451ae464a37414412d122ff6a283f713638dfa /tests
parentecfca6b1197658afb85fffd6f6ac9e92311a4b07 (diff)
Work in progress on adding public and protected properties to classes
Diffstat (limited to 'tests')
-rw-r--r--tests/simple/simple.cpp10
-rw-r--r--tests/simple/simple.php4
2 files changed, 10 insertions, 4 deletions
diff --git a/tests/simple/simple.cpp b/tests/simple/simple.cpp
index e8558a0..8b50496 100644
--- a/tests/simple/simple.cpp
+++ b/tests/simple/simple.cpp
@@ -59,8 +59,7 @@ public:
{
cout << "MyCustomClass::~MyCustomClass" << endl;
}
-
-
+
virtual void __construct()
{
cout << "MyCustomClass::__construct" << endl;
@@ -86,7 +85,7 @@ extern "C"
// create extension
static Php::Extension extension("simple","1.0");
- // define the functionsnm
+ // define the functions
extension.add("my_plus", my_plus, {
Php::ByVal("a", Php::stringType),
Php::ByVal("b", Php::arrayType),
@@ -95,7 +94,10 @@ extern "C"
});
// define classes
- extension.add("my_class", Php::Class<MyCustomClass>());
+ extension.add("my_class", Php::Class<MyCustomClass>({
+ Php::Public("a", 123),
+ Php::Protected("b", "abc")
+ }));
// return the module entry
return extension.module();
diff --git a/tests/simple/simple.php b/tests/simple/simple.php
index 07e3f78..f9919be 100644
--- a/tests/simple/simple.php
+++ b/tests/simple/simple.php
@@ -35,6 +35,10 @@ echo("g3: $g3\n");
if (class_exists("my_class")) echo("Warempel, de class bestaat\n");
$x = new my_class();
+
+echo("my_class::a = ".$x->a."\n");
+echo("my_class::b = ".$x->b."\n");
+
unset($x);
echo("done\n");