resetErrors() public method

public resetErrors ( )
Example #1
0
 public function testErrorHandler()
 {
     $this->if($includer = new testedClass($adapter = new atoum\test\adapter()))->and($adapter->error_reporting = E_ALL)->then->boolean($includer->errorHandler($errno = E_NOTICE, $message = uniqid(), $file = uniqid(), $line = rand(1, PHP_INT_MAX), $context = array()))->isTrue()->array($includer->getErrors())->isEqualTo(array(array($errno, $message, $file, $line, $context)))->boolean($includer->errorHandler($otherErrno = E_WARNING, $otherMessage = uniqid(), $otherFile = uniqid(), $otherLine = rand(1, PHP_INT_MAX), $otherContext = array()))->isTrue()->array($includer->getErrors())->isEqualTo(array(array($errno, $message, $file, $line, $context), array($otherErrno, $otherMessage, $otherFile, $otherLine, $otherContext)))->if($includer->resetErrors())->then->boolean($includer->errorHandler(E_USER_NOTICE, $errstr = uniqid(), uniqid(), rand(1, PHP_INT_MAX), uniqid()))->isTrue()->array($includer->getErrors())->isNotEmpty()->if($includer->resetErrors())->then->boolean($includer->errorHandler(E_USER_WARNING, $errstr = uniqid(), uniqid(), rand(1, PHP_INT_MAX), uniqid()))->isTrue()->array($includer->getErrors())->isNotEmpty()->if($includer->resetErrors())->then->boolean($includer->errorHandler(E_DEPRECATED, $errstr = uniqid(), uniqid(), rand(1, PHP_INT_MAX), uniqid()))->isTrue()->array($includer->getErrors())->isNotEmpty()->if($adapter->error_reporting = E_ALL & ~E_DEPRECATED)->and($includer->resetErrors())->then->boolean($includer->errorHandler(E_NOTICE, $errstr = uniqid(), uniqid(), rand(1, PHP_INT_MAX), uniqid()))->isTrue()->array($includer->getErrors())->isNotEmpty()->if($includer->resetErrors())->then->boolean($includer->errorHandler(E_WARNING, $errstr = uniqid(), uniqid(), rand(1, PHP_INT_MAX), uniqid()))->isTrue()->array($includer->getErrors())->isNotEmpty()->if($includer->resetErrors())->then->boolean($includer->errorHandler(E_USER_NOTICE, $errstr = uniqid(), uniqid(), rand(1, PHP_INT_MAX), uniqid()))->isTrue()->array($includer->getErrors())->isNotEmpty()->if($includer->resetErrors())->then->boolean($includer->errorHandler(E_USER_WARNING, $errstr = uniqid(), uniqid(), rand(1, PHP_INT_MAX), uniqid()))->isTrue()->array($includer->getErrors())->isNotEmpty()->if($includer->resetErrors())->then->boolean($includer->errorHandler(E_DEPRECATED, $errstr = uniqid(), uniqid(), rand(1, PHP_INT_MAX), uniqid()))->isTrue()->array($includer->getErrors())->isEmpty();
 }