From ad2b89c9a3696d0a52bf1e1fd01e9d0c682e0bc5 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 13 Jul 2004 07:12:06 +0000 Subject: [PATCH] ensure that test passes on systems without postgres built in. --- tests/lang/038.phpt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/lang/038.phpt b/tests/lang/038.phpt index b00728aef10..32a7399a493 100755 --- a/tests/lang/038.phpt +++ b/tests/lang/038.phpt @@ -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) --EXPECTF-- string(15) "Error2Exception" -string(10) "pg_connect" +string(5) "fopen" ===DONE===