summaryrefslogtreecommitdiff
path: root/tests/cpp/include/variables/007-overloaded-operators.h
diff options
context:
space:
mode:
authorvalmat <ufabiz@gmail.com>2014-03-28 19:00:17 +0600
committervalmat <ufabiz@gmail.com>2014-03-28 19:00:17 +0600
commit708a22fae15b13db871ca5ffc73004c70f0584fe (patch)
tree639e424f544f8ca5c950803620399c57fceb69bd /tests/cpp/include/variables/007-overloaded-operators.h
parent7bc500847e3027bb785c5525a21078ff72acc2ab (diff)
Changed the structure of the test file. With the increasing number of tests the old structure became uncomfortable.
Diffstat (limited to 'tests/cpp/include/variables/007-overloaded-operators.h')
-rw-r--r--tests/cpp/include/variables/007-overloaded-operators.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/cpp/include/variables/007-overloaded-operators.h b/tests/cpp/include/variables/007-overloaded-operators.h
new file mode 100644
index 0000000..88b3117
--- /dev/null
+++ b/tests/cpp/include/variables/007-overloaded-operators.h
@@ -0,0 +1,46 @@
+/**
+ *
+ * Test variables
+ * 007-overloaded-operators.phpt
+ *
+ */
+
+
+
+namespace TestVariables {
+
+ /*
+ * Test Php::Value overloaded operators
+ */
+ void overloaded_op(Php::Parameters &params)
+ {
+ Php::Value value = params[0];
+ if (value == "some string")
+ {
+ Php::out << "value == 'some string'" << std::endl;
+ }
+
+ if (value == 12)
+ {
+ Php::out << "value == 12" << std::endl;
+ }
+ else if (value > 100)
+ {
+ Php::out << "value > 100" << std::endl;
+ }
+
+ value += 10;
+ Php::out << value << std::endl;
+
+ int r1 = value - 8;
+ Php::out << r1 << std::endl;
+
+ double r2 = value*123.45;
+ Php::out << r2 << std::endl;
+
+ double r3 = value/123.45;
+ Php::out << r3 << std::endl;
+ }
+
+}
+