mirror of
https://github.com/php/php-src.git
synced 2024-10-14 04:52:33 +00:00
971f8b0881
Added a more configurable error reporting interface to DB. Also added some more tests, and moved the DB tests to pear/DB/tests. #Usage example that prints and exits on every error: #$dbh = DB::connect($dsn); #$dbh->setErrorHandling(PEAR_ERROR_DIE); # #Example with plain callback function: #$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, "errorHandler"); # #Example with object callback function: #$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, array($obj, "errorHandler")); # #Handler functions/methods are called with the error object as a parameter. #
25 lines
420 B
PHP
25 lines
420 B
PHP
--TEST--
|
|
PEAR_Error in die mode
|
|
--SKIPIF--
|
|
--FILE--
|
|
<?php // -*- C++ -*-
|
|
|
|
// Test for: PEAR.php
|
|
// Parts tested: - PEAR_Error class
|
|
// - PEAR::isError static method
|
|
// testing PEAR_Error
|
|
|
|
require_once "PEAR.php";
|
|
|
|
error_reporting(4095);
|
|
|
|
print "mode=die: ";
|
|
$err = new PEAR_Error("test error!!\n", -42, PEAR_ERROR_DIE);
|
|
print $err->toString() . "\n";
|
|
|
|
?>
|
|
--GET--
|
|
--POST--
|
|
--EXPECT--
|
|
mode=die: test error!!
|