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

Breadcrumb

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

function ObjectProphecy::checkProphecyMethodsPredictions

Checks that registered method predictions do not fail.

Return value

void

Throws

\Prophecy\Exception\Prediction\AggregateException If any of registered predictions fail

\Prophecy\Exception\Call\UnexpectedCallException

File

vendor/phpspec/prophecy/src/Prophecy/Prophecy/ObjectProphecy.php, line 219

Class

ObjectProphecy
@author Konstantin Kudryashov <ever.zet@gmail.com>

Namespace

Prophecy\Prophecy

Code

public function checkProphecyMethodsPredictions() {
    $exception = new AggregateException(sprintf("%s:\n", get_class($this->reveal())));
    $exception->setObjectProphecy($this);
    $this->callCenter
        ->checkUnexpectedCalls();
    foreach ($this->methodProphecies as $prophecies) {
        foreach ($prophecies as $prophecy) {
            try {
                $prophecy->checkPrediction();
            } catch (PredictionException $e) {
                $exception->append($e);
            }
        }
    }
    if (count($exception->getExceptions())) {
        throw $exception;
    }
}
RSS feed
Powered by Drupal