diff options
| author | Marcus Boerger <helly@php.net> | 2004-04-13 19:06:39 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2004-04-13 19:06:39 +0000 |
| commit | f0c91bac50cecbe7595d61d58db3873087ce227c (patch) | |
| tree | 0648c9687ab2fa79199cbddd5ee9e8bb79a5a4d1 | |
| parent | ad2471cbbb81e2a959b0e75640378ec4134fc77f (diff) | |
| download | php-git-f0c91bac50cecbe7595d61d58db3873087ce227c.tar.gz | |
New tests (and ordering of tests)
| -rwxr-xr-x | ext/spl/tests/array_001.phpt (renamed from ext/spl/tests/array_object.phpt) | 0 | ||||
| -rwxr-xr-x | ext/spl/tests/array_002.phpt | 37 | ||||
| -rwxr-xr-x | ext/spl/tests/array_003.phpt | 49 | ||||
| -rwxr-xr-x | ext/spl/tests/array_004.phpt (renamed from ext/spl/tests/array_iterator.phpt) | 0 | ||||
| -rwxr-xr-x | ext/spl/tests/array_005.phpt (renamed from ext/spl/tests/array_object_iterator.phpt) | 0 |
5 files changed, 86 insertions, 0 deletions
diff --git a/ext/spl/tests/array_object.phpt b/ext/spl/tests/array_001.phpt index f2a9337501..f2a9337501 100755 --- a/ext/spl/tests/array_object.phpt +++ b/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-- +<?php if (!extension_loaded("spl")) print "skip"; ?> +--FILE-- +<?php + +$array = array('1' => 'one', + '2' => 'two', + '3' => 'three'); + +$object = new ArrayObject($array); +$object[] = 'four'; + +$arrayObject = new ArrayObject($object); + +$arrayObject[] = 'five'; + +var_dump($arrayObject); + +?> +===DONE=== +<?php exit(0); ?> +--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-- +<?php if (!extension_loaded("spl")) print "skip"; ?> +--FILE-- +<?php + +class test +{ + public $pub = "public"; + protected $pro = "protected"; + private $pri = "private"; + + function __construct() + { + $this->imp = "implicit"; + } +}; + +$test = new test; +$test->dyn = "dynamic"; + +print_r($test); + +$object = new ArrayObject($test); + +print_r($object); + +?> +===DONE=== +<?php exit(0); ?> +--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 index c66fc08104..c66fc08104 100755 --- a/ext/spl/tests/array_iterator.phpt +++ b/ext/spl/tests/array_004.phpt diff --git a/ext/spl/tests/array_object_iterator.phpt b/ext/spl/tests/array_005.phpt index 9214a4c92b..9214a4c92b 100755 --- a/ext/spl/tests/array_object_iterator.phpt +++ b/ext/spl/tests/array_005.phpt |
