summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorvalmat <ufabiz@gmail.com>2014-03-28 22:34:50 +0600
committervalmat <ufabiz@gmail.com>2014-03-28 22:34:50 +0600
commit00f105e5490c96d2b39431d320f44e0f2ef040a5 (patch)
tree3fa6ce89b98569ba8fa32546eb399dfb0c92768a /tests
parent4091487adfbfd07750524fd7910d7178af21f816 (diff)
new test: Test class with static property and class constant
Diffstat (limited to 'tests')
-rw-r--r--tests/cpp/include/variables/013-018-calling-php-functions.h10
-rw-r--r--tests/cpp/main.cpp5
-rw-r--r--tests/php/phpt/class_obj/004-static-prop.phpt19
3 files changed, 24 insertions, 10 deletions
diff --git a/tests/cpp/include/variables/013-018-calling-php-functions.h b/tests/cpp/include/variables/013-018-calling-php-functions.h
index c646f60..9a77408 100644
--- a/tests/cpp/include/variables/013-018-calling-php-functions.h
+++ b/tests/cpp/include/variables/013-018-calling-php-functions.h
@@ -108,16 +108,6 @@ namespace TestVariables {
// call callable object of class from user space
Php::Object clbl("CallableClass", "Arctics around mount Meru");
Php::out << clbl("is the birthplace of the Hyperboreans") << std::endl;
-
-
-
- //::someMethod
- //(new usrspClass("Mount Meru"))->someMethod("is in the Arctics");
-
-
-
-
-
}
/**
diff --git a/tests/cpp/main.cpp b/tests/cpp/main.cpp
index 5d0d0a6..db2416d 100644
--- a/tests/cpp/main.cpp
+++ b/tests/cpp/main.cpp
@@ -49,6 +49,11 @@ extern "C"
customClass.property("property1", "prop1");
customClass.property("property2", "prop2", Php::Protected);
+ customClass.property("CONSTANT1", "some string", Php::Const);
+ customClass.property("EXP", 2.718281828459, Php::Const);
+ customClass.property("CONSTANT2", -2582341, Php::Const);
+ customClass.property("CONSTANT1", true, Php::Const);
+
// add the class to the extension
extension.add(customClass);
diff --git a/tests/php/phpt/class_obj/004-static-prop.phpt b/tests/php/phpt/class_obj/004-static-prop.phpt
new file mode 100644
index 0000000..4073247
--- /dev/null
+++ b/tests/php/phpt/class_obj/004-static-prop.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Test class with static property and class constant
+--SKIPIF--
+<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?>
+--FILEEOF--
+<?php
+
+var_dump( TestBaseClass\MyClass::CONSTANT1 );
+var_dump( TestBaseClass\MyClass::EXP );
+var_dump( TestBaseClass\MyClass::CONSTANT2 );
+var_dump( TestBaseClass\MyClass::CONSTANT1 );
+
+
+//echo PHP_EOL;
+--EXPECT--
+bool(true)
+float(2.718281828459)
+int(-2582341)
+bool(true) \ No newline at end of file