]> granicus.if.org Git - php/commitdiff
Add test covering for #47671
authorEtienne Kneuss <colder@php.net>
Thu, 19 Mar 2009 02:46:41 +0000 (02:46 +0000)
committerEtienne Kneuss <colder@php.net>
Thu, 19 Mar 2009 02:46:41 +0000 (02:46 +0000)
ext/spl/tests/observer_009.phpt [new file with mode: 0644]

diff --git a/ext/spl/tests/observer_009.phpt b/ext/spl/tests/observer_009.phpt
new file mode 100644 (file)
index 0000000..6ac676c
--- /dev/null
@@ -0,0 +1,30 @@
+--TEST--
+SPL: SplObjectStorage addAll/removeAll
+--FILE--
+<?php
+class Foo {}
+
+$storageA = new \SplObjectStorage();
+$storageA->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===
+<?php exit(0); ?>
+--EXPECTF--
+Count storage A: 2 x  x 
+Count storage B: 2 x  x 
+===DONE===