* @copyright PHP Application Tools
* @package patError
* @subpackage Examples
* @license LGPL, see license.txt for details
* @link http://www.php-tools.net
*/
/**
* patErrorManager class
*/
include_once '../patErrorManager.php';
// setup handler for each error-level
patErrorManager::setErrorHandling( E_ERROR, 'verbose' );
patErrorManager::setErrorHandling( E_WARNING, 'verbose' );
patErrorManager::setErrorHandling( E_NOTICE, 'echo' );
echo 'Sometimes errors will be expected.
';
patErrorManager::pushExpect( array( 'ex_123', 'ex_456' ) );
patErrorManager::pushExpect( array( 'ex_55', 'ex_66', 'ex_77', 'ex_88', 'ex_99' ) );
patErrorManager::pushExpect( 111 );
$expects = patErrorManager::getExpect();
echo '
expects'; $e = patErrorManager::raiseNotice( 'notExpected_111', 'This is just a notice.', 'Care for it, or leave it.' ); if( patErrorManager::isError( $e ) ) { echo 'This error was not expected
'; print_r( $expects ); echo '
expects'; exit; ?>
'; print_r( $expects ); echo '