summaryrefslogtreecommitdiff
path: root/tests/php/phpt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/php/phpt')
-rw-r--r--tests/php/phpt/class_obj/004-static-prop.phpt19
-rw-r--r--tests/php/phpt/class_obj/005-static-prop.phpt32
-rw-r--r--tests/php/phpt/variables/019-HashMember-1.phpt27
-rw-r--r--tests/php/phpt/variables/020-HashMember-2.phpt76
-rw-r--r--tests/php/phpt/variables/021-HashMember-3.phpt27
-rw-r--r--tests/php/phpt/variables/022-HashMember-4.phpt37
6 files changed, 199 insertions, 19 deletions
diff --git a/tests/php/phpt/class_obj/004-static-prop.phpt b/tests/php/phpt/class_obj/004-static-prop.phpt
deleted file mode 100644
index 4073247..0000000
--- a/tests/php/phpt/class_obj/004-static-prop.phpt
+++ /dev/null
@@ -1,19 +0,0 @@
---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
diff --git a/tests/php/phpt/class_obj/005-static-prop.phpt b/tests/php/phpt/class_obj/005-static-prop.phpt
new file mode 100644
index 0000000..c0aa2ef
--- /dev/null
+++ b/tests/php/phpt/class_obj/005-static-prop.phpt
@@ -0,0 +1,32 @@
+--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::CONSTANT3 );
+
+var_dump( TestBaseClass\MyClass::$StatProp1 );
+var_dump( TestBaseClass\MyClass::$Exp );
+var_dump( TestBaseClass\MyClass::$StatProp2 );
+var_dump( TestBaseClass\MyClass::$StatProp3 );
+TestBaseClass\MyClass::$StatProp2 = "otherval";
+var_dump( TestBaseClass\MyClass::$StatProp2 );
+
+
+//echo PHP_EOL;
+--EXPECT--
+string(11) "some string"
+float(2.718281828459)
+int(-2582341)
+bool(true)
+string(11) "some string"
+float(2.718281828459)
+int(-2582341)
+bool(true)
+string(8) "otherval" \ No newline at end of file
diff --git a/tests/php/phpt/variables/019-HashMember-1.phpt b/tests/php/phpt/variables/019-HashMember-1.phpt
new file mode 100644
index 0000000..ebc126f
--- /dev/null
+++ b/tests/php/phpt/variables/019-HashMember-1.phpt
@@ -0,0 +1,27 @@
+--TEST--
+get_complex_array (test HashMember #1)
+--SKIPIF--
+<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?>
+--FILEEOF--
+<?php
+
+/*
+$r = array();
+$r["key1"] = array();
+$r["key1"]["key2"] = "val2";
+$r["key1"]["key3"] = "val3";
+var_export($r);echo "\n";
+*/
+
+var_export(TestVariables\test_HashMember_1());
+
+
+echo PHP_EOL;
+--EXPECT--
+array (
+ 'key1' =>
+ array (
+ 'key2' => 'val2',
+ 'key3' => 'val3',
+ ),
+) \ No newline at end of file
diff --git a/tests/php/phpt/variables/020-HashMember-2.phpt b/tests/php/phpt/variables/020-HashMember-2.phpt
new file mode 100644
index 0000000..bb48d06
--- /dev/null
+++ b/tests/php/phpt/variables/020-HashMember-2.phpt
@@ -0,0 +1,76 @@
+--TEST--
+get_complex_array (test HashMember #2)
+--SKIPIF--
+<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?>
+--FILEEOF--
+<?php
+
+/*
+$r = 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] = NULL;
+$r["c"][2] = array();
+$r["c"][3] = "example";
+var_export($r);echo "\n";
+*/
+
+var_export(TestVariables\test_HashMember_2());
+
+
+echo PHP_EOL;
+--EXPECT--
+array (
+ 'k1' =>
+ array (
+ 'k3' => 'v1',
+ 'k2' =>
+ array (
+ 'k4' => 'v2',
+ ),
+ ),
+ 'k5' =>
+ array (
+ 1 => 'v3',
+ ),
+ 2 =>
+ array (
+ 'k6' =>
+ array (
+ 1 => 'v4',
+ ),
+ ),
+ 3 =>
+ array (
+ 4 =>
+ array (
+ 1 => 'v5',
+ 2 =>
+ array (
+ 5 =>
+ array (
+ 7 =>
+ array (
+ 11 => 'v5',
+ 'k' => 'v5',
+ ),
+ ),
+ ),
+ ),
+ ),
+ 'c' =>
+ array (
+ 0 => 'nested value',
+ 1 => NULL,
+ 2 =>
+ array (
+ ),
+ 3 => 'example',
+ ),
+) \ No newline at end of file
diff --git a/tests/php/phpt/variables/021-HashMember-3.phpt b/tests/php/phpt/variables/021-HashMember-3.phpt
new file mode 100644
index 0000000..c6c517f
--- /dev/null
+++ b/tests/php/phpt/variables/021-HashMember-3.phpt
@@ -0,0 +1,27 @@
+--TEST--
+get_complex_array (test HashMember #3)
+--SKIPIF--
+<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?>
+--FILEEOF--
+<?php
+
+/*
+$r = array();
+$r["key1"] = array();
+$r["key1"]["key2"] = "val1-2";
+$r["key1"]["key3"] = "val1-3";
+var_export($r);echo "\n";
+*/
+
+var_export(TestVariables\test_HashMember_3());
+
+
+echo PHP_EOL;
+--EXPECT--
+array (
+ 'key1' =>
+ array (
+ 'key2' => 'val1-2',
+ 'key3' => 'val1-3',
+ ),
+) \ No newline at end of file
diff --git a/tests/php/phpt/variables/022-HashMember-4.phpt b/tests/php/phpt/variables/022-HashMember-4.phpt
new file mode 100644
index 0000000..cbdc8b0
--- /dev/null
+++ b/tests/php/phpt/variables/022-HashMember-4.phpt
@@ -0,0 +1,37 @@
+--TEST--
+get_complex_array (test HashMember #4)
+--SKIPIF--
+<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?>
+--FILEEOF--
+<?php
+
+var_export(TestVariables\test_HashMember_4());
+
+
+echo PHP_EOL;
+--EXPECT--
+array (
+ 0 =>
+ array (
+ 'key1' =>
+ array (
+ 'key2' =>
+ array (
+ 'key3' => 'val',
+ ),
+ ),
+ ),
+ 1 =>
+ array (
+ 'str1' => 'example',
+ 'str2' => 'example',
+ ),
+ 2 =>
+ array (
+ 'str1' =>
+ array (
+ 'str2' => 'val1-2',
+ 'str3' => 'val1-3',
+ ),
+ ),
+) \ No newline at end of file