summaryrefslogtreecommitdiff
path: root/tests/cpp/include/variables/020-HashMember-2.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-04-05 20:46:22 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-04-05 20:46:22 +0200
commit877f40e4ec538260a58277ae9e3a50abcc857542 (patch)
tree0c26658a203c7762833f5946b6d4d7d02d876e46 /tests/cpp/include/variables/020-HashMember-2.h
parent5973954b7428aa95ec8f0b2424b5725d2815049f (diff)
parentcdae9845ac7c223d12bafc0fcd146cfae2c61363 (diff)
Merge pull request #67 from valmat/tests
add tests for HashMember
Diffstat (limited to 'tests/cpp/include/variables/020-HashMember-2.h')
-rw-r--r--tests/cpp/include/variables/020-HashMember-2.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/cpp/include/variables/020-HashMember-2.h b/tests/cpp/include/variables/020-HashMember-2.h
new file mode 100644
index 0000000..dfa95c2
--- /dev/null
+++ b/tests/cpp/include/variables/020-HashMember-2.h
@@ -0,0 +1,41 @@
+/**
+ *
+ * Test variables
+ * 019-HashMember-2.phpt
+ * Test HashMember
+ *
+ */
+
+
+
+
+/**
+ * Set up namespace
+ */
+namespace TestVariables {
+
+ /**
+ * This function returns complex array
+ */
+ Php::Value test_HashMember_2()
+ {
+ Php::Value r, empty_array(Php::Type::Array);
+ r["k1"]["k3"] = "v1";
+ r["k1"]["k2"]["k4"] = "v2";
+ r["k5"][1] = "v3";
+ r[2]["k6"][1] = "v4";
+ r[3][4][1] = "v5";
+ r[3][4][2][5][7][11] = "v5";
+ r[3][4][2][5][7]["k"] = "v5";
+ r["c"][0] = "nested value";
+ r["c"][1] = nullptr;
+ r["c"][2] = empty_array;
+ r["c"][3] = "example";
+ return r;
+ }
+
+/**
+ * End of namespace
+ */
+}
+