From c44d7b357677220159ed7e7dc373d133f87ffb81 Mon Sep 17 00:00:00 2001 From: Etienne Kneuss Date: Thu, 19 Mar 2009 02:47:00 +0000 Subject: [PATCH] MFH: Add test covering for #47671 --- ext/spl/tests/observer_009.phpt | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 ext/spl/tests/observer_009.phpt 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=== -- 2.50.1