mageekguy\atoum\score::addRuntimeException PHP Method

addRuntimeException() public method

public addRuntimeException ( $file, $class, $method, exceptions\runtime $exception )
$exception exceptions\runtime
    public function addRuntimeException($file, $class, $method, exceptions\runtime $exception)
    {
        $this->runtimeExceptions[] = $exception;
        return $this;
    }

Usage Example

Beispiel #1
0
 public function testMerge()
 {
     $this->if($score = new atoum\score())->and($otherScore = new atoum\score())->then->object($score->merge($otherScore))->isIdenticalTo($score)->integer($score->getPassNumber())->isZero()->array($score->getFailAssertions())->isEmpty()->array($score->getExceptions())->isEmpty()->array($score->getRuntimeExceptions())->isEmpty()->array($score->getErrors())->isEmpty()->array($score->getOutputs())->isEmpty()->array($score->getDurations())->isEmpty()->array($score->getMemoryUsages())->isEmpty()->array($score->getUncompletedMethods())->isEmpty()->array($score->getSkippedMethods())->isEmpty()->if($score->addPass())->and($score->addFail(uniqid(), uniqid(), uniqid(), rand(1, PHP_INT_MAX), new atoum\asserters\integer(new atoum\asserter\generator()), uniqid()))->and($score->addException(uniqid(), uniqid(), uniqid(), rand(1, PHP_INT_MAX), new \exception()))->and($score->addRuntimeException(uniqid(), uniqid(), uniqid(), new atoum\exceptions\runtime()))->and($score->addError(uniqid(), uniqid(), uniqid(), rand(1, PHP_INT_MAX), E_ERROR, uniqid(), uniqid(), rand(1, PHP_INT_MAX)))->and($score->addOutput(uniqid(), uniqid(), uniqid(), uniqid()))->and($score->addDuration(uniqid(), uniqid(), uniqid(), rand(1, PHP_INT_MAX)))->and($score->addMemoryUsage(uniqid(), uniqid(), uniqid(), rand(1, PHP_INT_MAX)))->and($score->addUncompletedMethod(uniqid(), uniqid(), uniqid(), rand(1, PHP_INT_MAX), uniqid()))->and($score->addSkippedMethod(uniqid(), uniqid(), uniqid(), rand(1, PHP_INT_MAX), uniqid()))->then->object($score->merge($otherScore))->isIdenticalTo($score)->integer($score->getPassNumber())->isEqualTo(1)->integer($score->getFailNumber())->isEqualTo(1)->integer($score->getExceptionNumber())->isEqualTo(1)->integer($score->getErrorNumber())->isEqualTo(1)->integer($score->getOutputNumber())->isEqualTo(1)->integer($score->getDurationNumber())->isEqualTo(1)->integer($score->getMemoryUsageNumber())->isEqualTo(1)->integer($score->getUncompletedMethodNumber())->isEqualTo(1)->integer($score->getSkippedMethodNumber())->isEqualTo(1)->if($otherScore->addPass())->and($otherScore->addFail(uniqid(), uniqid(), uniqid(), rand(1, PHP_INT_MAX), new atoum\asserters\integer(new atoum\asserter\generator()), uniqid()))->and($otherScore->addException(uniqid(), uniqid(), uniqid(), rand(1, PHP_INT_MAX), new \exception()))->and($otherScore->addRuntimeException(uniqid(), uniqid(), uniqid(), new atoum\exceptions\runtime()))->and($otherScore->addError(uniqid(), uniqid(), uniqid(), rand(1, PHP_INT_MAX), E_ERROR, uniqid(), uniqid(), rand(1, PHP_INT_MAX)))->and($otherScore->addOutput(uniqid(), uniqid(), uniqid(), uniqid()))->and($otherScore->addDuration(uniqid(), uniqid(), uniqid(), rand(1, PHP_INT_MAX)))->and($otherScore->addMemoryUsage(uniqid(), uniqid(), uniqid(), rand(1, PHP_INT_MAX)))->and($otherScore->addUncompletedMethod(uniqid(), uniqid(), uniqid(), rand(1, PHP_INT_MAX), uniqid()))->and($otherScore->addSkippedMethod(uniqid(), uniqid(), uniqid(), rand(1, PHP_INT_MAX), uniqid()))->then->object($score->merge($otherScore))->isIdenticalTo($score)->integer($score->getPassNumber())->isEqualTo(2)->integer($score->getFailNumber())->isEqualTo(2)->integer($score->getExceptionNumber())->isEqualTo(2)->integer($score->getRuntimeExceptionNumber())->isEqualTo(2)->integer($score->getErrorNumber())->isEqualTo(2)->integer($score->getOutputNumber())->isEqualTo(2)->integer($score->getDurationNumber())->isEqualTo(2)->integer($score->getMemoryUsageNumber())->isEqualTo(2)->integer($score->getUncompletedMethodNumber())->isEqualTo(2)->integer($score->getSkippedMethodNumber())->isEqualTo(2)->object($score->merge($otherScore))->isIdenticalTo($score)->integer($score->getPassNumber())->isEqualTo(3)->integer($score->getFailNumber())->isEqualTo(3)->integer($score->getExceptionNumber())->isEqualTo(3)->integer($score->getRuntimeExceptionNumber())->isEqualTo(3)->integer($score->getErrorNumber())->isEqualTo(3)->integer($score->getOutputNumber())->isEqualTo(3)->integer($score->getDurationNumber())->isEqualTo(3)->integer($score->getMemoryUsageNumber())->isEqualTo(3)->integer($score->getUncompletedMethodNumber())->isEqualTo(3)->integer($score->getSkippedMethodNumber())->isEqualTo(3);
 }