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