From: Etienne Kneuss Date: Thu, 19 Mar 2009 02:46:41 +0000 (+0000) Subject: Add test covering for #47671 X-Git-Tag: php-5.4.0alpha1~191^2~4098 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=24835e7fb119b426c781633568c21620a2c59636;p=php Add test covering for #47671 --- diff --git a/ext/spl/tests/observer_009.phpt b/ext/spl/tests/observer_009.phpt new file mode 100644 index 0000000000..6ac676c492 --- /dev/null +++ b/ext/spl/tests/observer_009.phpt @@ -0,0 +1,30 @@ +--TEST-- +SPL: SplObjectStorage addAll/removeAll +--FILE-- +attach(new \Foo); +$storageA->attach(new \Foo); + +echo ("Count storage A: " . count($storageA)); +foreach ($storageA as $object) { + echo ' x '; +} + +echo "\n"; +$storageB = clone $storageA; + +echo ("Count storage B: " . count($storageB)); +foreach ($storageB as $object) { + echo ' x '; +} +echo "\n"; +?> +===DONE=== + +--EXPECTF-- +Count storage A: 2 x x +Count storage B: 2 x x +===DONE===