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

20 lines
373 B
Plaintext
Raw Normal View History

2009-05-23 23:37:36 +08:00
--TEST--
Check that SplObjectStorage::offsetGet throws exception when non-existing object is requested
--CREDITS--
PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com)
--FILE--
<?php
$s = new SplObjectStorage();
$o1 = new stdClass();
try {
2020-02-04 05:52:20 +08:00
$s->offsetGet($o1);
2009-05-23 23:37:36 +08:00
} catch (UnexpectedValueException $e) {
2020-02-04 05:52:20 +08:00
echo $e->getMessage();
2009-05-23 23:37:36 +08:00
}
?>
--EXPECT--
Object not found