mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
ensure that test passes on systems without postgres built in.
This commit is contained in:
parent
196259d334
commit
ad2b89c9a3
@ -5,7 +5,7 @@ Convert wanrings to exceptions
|
||||
|
||||
class MyException extends Exception
|
||||
{
|
||||
function __construct($errstr, $errno, $errfile, $errline)
|
||||
function __construct($errstr, $errno=0, $errfile='', $errline='')
|
||||
{
|
||||
parent::__construct($errstr, $errno);
|
||||
$this->file = $errfile;
|
||||
@ -15,7 +15,7 @@ class MyException extends Exception
|
||||
|
||||
function Error2Exception($errno, $errstr, $errfile, $errline)
|
||||
{
|
||||
throw new ErrorException($errstr, $errno);//, $errfile, $errline);
|
||||
throw new MyException($errstr, $errno);//, $errfile, $errline);
|
||||
}
|
||||
|
||||
$err_msg = 'no exception';
|
||||
@ -23,7 +23,7 @@ set_error_handler('Error2Exception');
|
||||
|
||||
try
|
||||
{
|
||||
$con = pg_connect('host=localhost dbname=xtest');
|
||||
$con = fopen("/tmp/a_file_that_does_not_exist",'r');
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
@ -37,5 +37,5 @@ catch (Exception $e)
|
||||
<?php exit(0); ?>
|
||||
--EXPECTF--
|
||||
string(15) "Error2Exception"
|
||||
string(10) "pg_connect"
|
||||
string(5) "fopen"
|
||||
===DONE===
|
||||
|
Loading…
Reference in New Issue
Block a user