cvs: ZendEngine2 /tests catch_002.phpt catch_003.phpt catch_004.phpt
| From: | Marcus Boerger | Date: | Sat, 20 May 2006 09:08:00 +0000 |
| Subject: | cvs: ZendEngine2 /tests catch_002.phpt catch_003.phpt catch_004.phpt | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4903@lists.php.net to get a copy of this message | ||
helly Sat May 20 09:08:00 2006 UTC
Added files:
/ZendEngine2/tests catch_002.phpt catch_003.phpt catch_004.phpt
Log:
- Add new tests
# Now who finds the error in php code?
http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/catch_002.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/catch_002.phpt
+++ ZendEngine2/tests/catch_002.phpt
--TEST--
Catching an exception in a constructor
--FILE--
<?php
class MyObject
{
function __construct()
{
throw new Exception();
echo __METHOD__ . "() Must not be reached\n";
}
function __destruct()
{
echo __METHOD__ . "() Must not be called\n";
}
}
try
{
new MyObject();
}
catch(Exception $e)
{
echo "Caught\n";
}
?>
===DONE===
--EXPECT--
Caught
===DONE===
http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/catch_003.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/catch_003.phpt
+++ ZendEngine2/tests/catch_003.phpt
--TEST--
Catching an exception in a constructor fired form a static method
--FILE--
<?php
class MyObject
{
function fail()
{
throw new Exception();
}
function __construct()
{
self::fail();
echo __METHOD__ . "() Must not be reached\n";
}
function __destruct()
{
echo __METHOD__ . "() Must not be called\n";
}
}
try
{
new MyObject();
}
catch(Exception $e)
{
echo "Caught\n";
}
?>
===DONE===
--EXPECT--
Caught
===DONE===
http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/catch_004.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/catch_004.phpt
+++ ZendEngine2/tests/catch_004.phpt
--TEST--
Catching an exception in a constructor inside a static method
--FILE--
<?php
class MyObject
{
function fail()
{
throw new Exception();
}
function __construct()
{
self::fail();
echo __METHOD__ . "() Must not be reached\n";
}
function __destruct()
{
echo __METHOD__ . "() Must not be called\n";
}
function test()
{
try
{
new MyObject();
}
catch(Exception $e)
{
echo "Caught\n";
}
}
}
?>
===DONE===
--EXPECT--
Caught
===DONE===