php-src/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter1.phpt

28 lines
580 B
Plaintext
Raw Normal View History

2009-05-23 15:37:36 +00:00
--TEST--
Check that SplObjectStorage::unserialize returns NULL when non-string param is passed
--CREDITS--
PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com)
--FILE--
<?php
$data_provider = array(
array(),
new stdClass(),
);
foreach($data_provider as $input) {
$s = new SplObjectStorage();
var_dump($s->unserialize($input));
}
?>
--EXPECTF--
2016-11-22 21:12:07 +00:00
Warning: SplObjectStorage::unserialize() expects parameter 1 to be string, array given in %s on line %d
2009-05-23 15:37:36 +00:00
NULL
2016-11-22 21:12:07 +00:00
Warning: SplObjectStorage::unserialize() expects parameter 1 to be string, object given in %s on line %d
2009-05-23 15:37:36 +00:00
NULL