mirror of
https://github.com/php/php-src.git
synced 2024-09-24 19:37:26 +00:00
- MFH: Add new test
This commit is contained in:
parent
660956b514
commit
4b4d61952f
31
ext/spl/tests/array_021.phpt
Executable file
31
ext/spl/tests/array_021.phpt
Executable file
@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
SPL: ArrayObject::seek() and exceptions
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class foo extends ArrayObject
|
||||
{
|
||||
public function seek($key)
|
||||
{
|
||||
echo __METHOD__ . "($key)\n";
|
||||
throw new Exception("hi");
|
||||
}
|
||||
}
|
||||
|
||||
$test = new foo(array(1,2,3));
|
||||
|
||||
try
|
||||
{
|
||||
$test->seek('bar');
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
echo "got exception\n";
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
foo::seek(bar)
|
||||
got exception
|
||||
===DONE===
|
Loading…
Reference in New Issue
Block a user