getStopOnError() public méthode

Return true if the runner should exit on the first exception encountered.
public getStopOnError ( )
Exemple #1
0
 private function runVariant(ExecutorInterface $executor, RunnerContext $context, SubjectMetadata $subjectMetadata, Variant $variant)
 {
     $executorConfig = $this->executorRegistry->getConfig($context->getExecutor());
     $this->logger->variantStart($variant);
     $rejectCount = [];
     try {
         foreach ($variant->getIterations() as $iteration) {
             $rejectCount[spl_object_hash($iteration)] = 0;
             $this->runIteration($executor, $executorConfig, $iteration, $subjectMetadata);
         }
     } catch (\Exception $e) {
         $variant->setException($e);
         $this->logger->variantEnd($variant);
         if ($context->getStopOnError()) {
             throw new StopOnErrorException();
         }
         return;
     }
     $variant->computeStats();
     $this->logger->variantEnd($variant);
     while ($variant->getRejectCount() > 0) {
         $this->logger->retryStart($variant->getRejectCount());
         $this->logger->variantStart($variant);
         foreach ($variant->getRejects() as $reject) {
             $rejectCount[spl_object_hash($reject)]++;
             $this->runIteration($executor, $executorConfig, $reject, $subjectMetadata);
         }
         $variant->computeStats();
         $this->logger->variantEnd($variant);
         $reject->setResult(new RejectionCountResult($rejectCount[spl_object_hash($reject)]));
     }
 }