diff options
author | valmat <ufabiz@gmail.com> | 2014-04-05 22:00:55 +0600 |
---|---|---|
committer | valmat <ufabiz@gmail.com> | 2014-04-05 22:00:55 +0600 |
commit | 61374e5ddd285f9a125a52005ad7eaefd3585f02 (patch) | |
tree | 6e4388f8a2ee419d14fb21e25777844db5805bde /tests/php/phpt/variables/020-HashMember-2.phpt | |
parent | ffdccb83d460791202bdb258dbb9106da877da3b (diff) |
add tests for HashMember
Diffstat (limited to 'tests/php/phpt/variables/020-HashMember-2.phpt')
-rw-r--r-- | tests/php/phpt/variables/020-HashMember-2.phpt | 76 |
1 files changed, 76 insertions, 0 deletions
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 |