From: Ferenc Kovacs Date: Sat, 26 Nov 2011 18:41:45 +0000 (+0000) Subject: adding some tests for string offsets X-Git-Tag: php-5.4.0RC3~52 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=52ddf31284be8560b672b0c4976c839dd3fbd4f5;p=php adding some tests for string offsets --- diff --git a/tests/strings/offsets_chaining_1.phpt b/tests/strings/offsets_chaining_1.phpt new file mode 100644 index 0000000000..eecdfb9637 --- /dev/null +++ b/tests/strings/offsets_chaining_1.phpt @@ -0,0 +1,12 @@ +--TEST-- +testing the behavior of string offset chaining +--INI-- +error_reporting=E_ALL | E_DEPRECATED +--FILE-- + +--EXPECTF-- +string(1) "f" + diff --git a/tests/strings/offsets_chaining_2.phpt b/tests/strings/offsets_chaining_2.phpt new file mode 100644 index 0000000000..07f67f0fd0 --- /dev/null +++ b/tests/strings/offsets_chaining_2.phpt @@ -0,0 +1,12 @@ +--TEST-- +testing the behavior of string offset chaining +--INI-- +error_reporting=E_ALL | E_DEPRECATED +--FILE-- + +--EXPECTF-- +string(1) "f" + diff --git a/tests/strings/offsets_chaining_3.phpt b/tests/strings/offsets_chaining_3.phpt new file mode 100644 index 0000000000..23b8e70179 --- /dev/null +++ b/tests/strings/offsets_chaining_3.phpt @@ -0,0 +1,12 @@ +--TEST-- +testing the behavior of string offset chaining +--INI-- +error_reporting=E_ALL | E_DEPRECATED +--FILE-- + +--EXPECTF-- +bool(true) + diff --git a/tests/strings/offsets_chaining_4.phpt b/tests/strings/offsets_chaining_4.phpt new file mode 100644 index 0000000000..79b95c135b --- /dev/null +++ b/tests/strings/offsets_chaining_4.phpt @@ -0,0 +1,12 @@ +--TEST-- +testing the behavior of string offset chaining +--INI-- +error_reporting=E_ALL | E_DEPRECATED +--FILE-- + +--EXPECTF-- +bool(true) + diff --git a/tests/strings/offsets_chaining_5.phpt b/tests/strings/offsets_chaining_5.phpt new file mode 100644 index 0000000000..f0e27c2cfd --- /dev/null +++ b/tests/strings/offsets_chaining_5.phpt @@ -0,0 +1,22 @@ +--TEST-- +testing the behavior of string offset chaining +--INI-- +error_reporting=E_ALL | E_DEPRECATED +--FILE-- + "foobar"); +var_dump(isset($array['expected_array'])); +var_dump($array['expected_array']); +var_dump(isset($array['expected_array']['foo'])); +var_dump($array['expected_array']['foo']); +var_dump(isset($array['expected_array']['foo']['bar'])); +var_dump($array['expected_array']['foo']['bar']); +?> +--EXPECTF-- +bool(true) +string(6) "foobar" +bool(true) +string(1) "f" +bool(true) +string(1) "f" + diff --git a/tests/strings/offsets_general.phpt b/tests/strings/offsets_general.phpt new file mode 100644 index 0000000000..3ad779d2d1 --- /dev/null +++ b/tests/strings/offsets_general.phpt @@ -0,0 +1,34 @@ +--TEST-- +testing the behavior of string offsets +--INI-- +error_reporting=E_ALL | E_DEPRECATED +--FILE-- + +--EXPECT-- +string(1) "f" +string(1) "o" +bool(true) +bool(true) +string(1) "f" +bool(true) +string(1) "f" +string(1) "o" +bool(true) +bool(true) +string(1) "f" +bool(true) +