Annotation of embedaddon/php/ext/spl/tests/SplObjectStorage_removeAll_invalid_parameter.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Check that SplObjectStorage::removeAll generate a warning and returns NULL when passed non-object param
3: --CREDITS--
4: PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com)
5: --FILE--
6: <?php
7:
8: $data_provider = array(
9: array(),
10: true,
11: "string",
12: 12345,
13: 1.2345,
14: NULL
15: );
16:
17: foreach($data_provider as $input) {
18:
19: $s = new SplObjectStorage();
20:
21: var_dump($s->removeAll($input));
22: }
23:
24: ?>
25: --EXPECTF--
26: Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, array given in %s on line %d
27: NULL
28:
29: Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, boolean given in %s on line %d
30: NULL
31:
32: Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, %unicode_string_optional% given in %s on line %d
33: NULL
34:
35: Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, integer given in %s on line %d
36: NULL
37:
38: Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, double given in %s on line %d
39: NULL
40:
41: Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, null given in %s on line %d
42: NULL
43:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>