Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Prophet.php

function Prophet::checkPredictions

Checks all predictions defined by prophecies of this Prophet.

Return value

void

Throws

Exception\Prediction\AggregateException If any prediction fails

File

vendor/phpspec/prophecy/src/Prophecy/Prophet.php, line 132

Class

Prophet
Prophet creates prophecies.

Namespace

Prophecy

Code

public function checkPredictions() {
    $exception = new AggregateException("Some predictions failed:\n");
    foreach ($this->prophecies as $prophecy) {
        try {
            $prophecy->checkProphecyMethodsPredictions();
        } catch (PredictionException $e) {
            $exception->append($e);
        }
    }
    if (count($exception->getExceptions())) {
        throw $exception;
    }
}
RSS feed
Powered by Drupal