From f0c91bac50cecbe7595d61d58db3873087ce227c Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Tue, 13 Apr 2004 19:06:39 +0000 Subject: [PATCH] New tests (and ordering of tests) --- .../{array_object.phpt => array_001.phpt} | 0 ext/spl/tests/array_002.phpt | 37 ++++++++++++++ ext/spl/tests/array_003.phpt | 49 +++++++++++++++++++ .../{array_iterator.phpt => array_004.phpt} | 0 ...ay_object_iterator.phpt => array_005.phpt} | 0 5 files changed, 86 insertions(+) rename ext/spl/tests/{array_object.phpt => array_001.phpt} (100%) create mode 100755 ext/spl/tests/array_002.phpt create mode 100755 ext/spl/tests/array_003.phpt rename ext/spl/tests/{array_iterator.phpt => array_004.phpt} (100%) rename ext/spl/tests/{array_object_iterator.phpt => array_005.phpt} (100%) diff --git a/ext/spl/tests/array_object.phpt b/ext/spl/tests/array_001.phpt similarity index 100% rename from ext/spl/tests/array_object.phpt rename to ext/spl/tests/array_001.phpt diff --git a/ext/spl/tests/array_002.phpt b/ext/spl/tests/array_002.phpt new file mode 100755 index 0000000000..960253f335 --- /dev/null +++ b/ext/spl/tests/array_002.phpt @@ -0,0 +1,37 @@ +--TEST-- +SPL: ArrayObject copy constructor +--SKIPIF-- + +--FILE-- + 'one', + '2' => 'two', + '3' => 'three'); + +$object = new ArrayObject($array); +$object[] = 'four'; + +$arrayObject = new ArrayObject($object); + +$arrayObject[] = 'five'; + +var_dump($arrayObject); + +?> +===DONE=== + +--EXPECTF-- +object(ArrayObject)#%d (5) { + [1]=> + string(3) "one" + [2]=> + string(3) "two" + [3]=> + string(5) "three" + [4]=> + string(4) "four" + [5]=> + string(4) "five" +} +===DONE=== diff --git a/ext/spl/tests/array_003.phpt b/ext/spl/tests/array_003.phpt new file mode 100755 index 0000000000..b7de6a78ae --- /dev/null +++ b/ext/spl/tests/array_003.phpt @@ -0,0 +1,49 @@ +--TEST-- +SPL: ArrayObject from object +--SKIPIF-- + +--FILE-- +imp = "implicit"; + } +}; + +$test = new test; +$test->dyn = "dynamic"; + +print_r($test); + +$object = new ArrayObject($test); + +print_r($object); + +?> +===DONE=== + +--EXPECTF-- +test Object +( + [pub] => public + [pro:protected] => protected + [pri:private] => private + [imp] => implicit + [dyn] => dynamic +) +ArrayObject Object +( + [pub] => public + [pro:protected] => protected + [pri:private] => private + [imp] => implicit + [dyn] => dynamic +) +===DONE=== diff --git a/ext/spl/tests/array_iterator.phpt b/ext/spl/tests/array_004.phpt similarity index 100% rename from ext/spl/tests/array_iterator.phpt rename to ext/spl/tests/array_004.phpt diff --git a/ext/spl/tests/array_object_iterator.phpt b/ext/spl/tests/array_005.phpt similarity index 100% rename from ext/spl/tests/array_object_iterator.phpt rename to ext/spl/tests/array_005.phpt -- 2.50.1