php-src/pear/tests/pear_error2.phpt
Stig Bakken 971f8b0881 @Added a more configurable error reporting interface to DB.
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.
#
2000-09-09 02:39:56 +00:00

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!!