From: Marcus Boerger Date: Sun, 27 Jun 2004 13:15:31 +0000 (+0000) Subject: Add more tests X-Git-Tag: php-5.0.0~115 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46e9abe602e1c584eda3a18cbe2aa737523c94a2;p=php Add more tests --- diff --git a/tests/lang/038.phpt b/tests/lang/038.phpt new file mode 100755 index 0000000000..b00728aef1 --- /dev/null +++ b/tests/lang/038.phpt @@ -0,0 +1,41 @@ +--TEST-- +Convert wanrings to exceptions +--FILE-- +file = $errfile; + $this->line = $errline; + } +} + +function Error2Exception($errno, $errstr, $errfile, $errline) +{ + throw new ErrorException($errstr, $errno);//, $errfile, $errline); +} + +$err_msg = 'no exception'; +set_error_handler('Error2Exception'); + +try +{ + $con = pg_connect('host=localhost dbname=xtest'); +} +catch (Exception $e) +{ + $trace = $e->getTrace(); + var_dump($trace[0]['function']); + var_dump($trace[1]['function']); +} + +?> +===DONE=== + +--EXPECTF-- +string(15) "Error2Exception" +string(10) "pg_connect" +===DONE===