From 708a22fae15b13db871ca5ffc73004c70f0584fe Mon Sep 17 00:00:00 2001 From: valmat Date: Fri, 28 Mar 2014 19:00:17 +0600 Subject: Changed the structure of the test file. With the increasing number of tests the old structure became uncomfortable. --- tests/cpp/include/class_obj/004-static-funct.h | 90 ++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 tests/cpp/include/class_obj/004-static-funct.h (limited to 'tests/cpp/include/class_obj/004-static-funct.h') diff --git a/tests/cpp/include/class_obj/004-static-funct.h b/tests/cpp/include/class_obj/004-static-funct.h new file mode 100644 index 0000000..d6816ab --- /dev/null +++ b/tests/cpp/include/class_obj/004-static-funct.h @@ -0,0 +1,90 @@ +/** + * + * Test Classes and objects + * 004-static-funct.phpt + * test static functions + * + */ + + + + +/** + * Set up namespace + */ +namespace TestBaseClass { + + + /** + * Regular function + * + * Because a regular function does not have a 'this' pointer, + * it has the same signature as static methods + * + * @param params Parameters passed to the function + */ + void testStaticRegFunc(Php::Parameters ¶ms) + { + Php::out << "testStatic regular function"<< std::endl; + } + + /** + * A very simple class that will not be exported to PHP + */ + class testStaticPrivClass + { + public: + /** + * C++ constructor and destructor + */ + testStaticPrivClass() {} + virtual ~testStaticPrivClass() {} + + /** + * Static method + * + * A static method also has no 'this' pointer and has + * therefore a signature identical to regular functions + * + * @param params Parameters passed to the method + */ + static void staticMethod(Php::Parameters ¶ms) + { + Php::out << "testStaticPrivClass::staticMethod()"<< std::endl; + } + }; + + /** + * A very simple class that will be exported to PHP + */ + class testStaticPubClass : public Php::Base + { + public: + /** + * C++ constructor and destructor + */ + testStaticPubClass() {} + virtual ~testStaticPubClass() {} + + /** + * Another static method + * + * This static has exactly the same signature as the + * regular function and static method that were mentioned + * before + * + * @param params Parameters passed to the method + */ + static void staticMethod(Php::Parameters ¶ms) + { + Php::out << "testStaticPubClass::staticMethod()"<< std::endl; + } + }; + + + +/** + * End of namespace + */ +} + -- cgit v1.2.3