From eed64ece657a0e7af4ba3429b4439c6d2b992598 Mon Sep 17 00:00:00 2001 From: Etienne Kneuss Date: Sat, 17 Jan 2009 01:30:43 +0000 Subject: [PATCH] Add tests for addAll/RemoveAll --- ext/spl/tests/observer_008.phpt | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 ext/spl/tests/observer_008.phpt diff --git a/ext/spl/tests/observer_008.phpt b/ext/spl/tests/observer_008.phpt new file mode 100644 index 00000000000..56a3c892c08 --- /dev/null +++ b/ext/spl/tests/observer_008.phpt @@ -0,0 +1,35 @@ +--TEST-- +SPL: SplObjectStorage addAll/removeAll +--FILE-- +attach($o1); +$a->attach($o2); + +$b = new SplObjectSTorage(); +$b->attach($o2); +$b->attach($o3); + +$a->addAll($b); + +var_dump($a->count()); + +$a->detach($o3); +var_dump($a->count()); + +$a->removeAll($b); +var_dump($a->count()); +?> +===DONE=== + +--EXPECTF-- +int(3) +int(2) +int(1) +===DONE===