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/variables/003-value-types.h | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/cpp/include/variables/003-value-types.h (limited to 'tests/cpp/include/variables/003-value-types.h') diff --git a/tests/cpp/include/variables/003-value-types.h b/tests/cpp/include/variables/003-value-types.h new file mode 100644 index 0000000..e1d31b9 --- /dev/null +++ b/tests/cpp/include/variables/003-value-types.h @@ -0,0 +1,39 @@ +/** + * + * Test variables + * 003-value-types.phpt + * + */ + + +namespace TestVariables { + + /* + * Check type of value + * @param array + */ + void value_types(Php::Parameters ¶ms) { + if (params.size() == 0) { + return; + } + + Php::Value arr = params[0]; + + Php::out << "Null: " << bool2str( arr.get("Null").type() == Php::Type::Null ) << std::endl; + Php::out << "Numeric: " << bool2str( arr.get("Numeric").type() == Php::Type::Numeric ) << std::endl; + Php::out << "Float: " << bool2str( arr.get("Float").type() == Php::Type::Float ) << std::endl; + Php::out << "Bool: " << bool2str( arr.get("Bool").type() == Php::Type::Bool ) << std::endl; + Php::out << "Array: " << bool2str( arr.get("Array").type() == Php::Type::Array ) << std::endl; + Php::out << "Object: " << bool2str( arr.get("Object").type() == Php::Type::Object ) << std::endl; + Php::out << "String: " << bool2str( arr.get("String").type() == Php::Type::String ) << std::endl; + Php::out << "Resource: " << bool2str( arr.get("Resource").type() == Php::Type::Resource ) << std::endl; + Php::out << "Constant: " << bool2str( arr.get("Constant").type() == Php::Type::Constant ) << std::endl; + Php::out << "ConstantArray: " << bool2str( arr.get("ConstantArray").type() == Php::Type::ConstantArray ) << std::endl; + Php::out << "Callable1: " << bool2str( arr.get("Callable1").type() == Php::Type::Callable ) << std::endl; + Php::out << "Callable2: " << bool2str( arr.get("Callable2").type() == Php::Type::Callable ) << std::endl; + Php::out << "Callable3: " << bool2str( arr.get("Callable3").type() == Php::Type::Callable ) << std::endl; + Php::out << "Callable4: " << bool2str( arr.get("Callable4").type() == Php::Type::Callable ) << std::endl; + } + +} + -- cgit v1.2.3