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

Breadcrumb

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

function ObjectProphecy::reveal

Reveals double.

@phpstan-return T

Return value

object

Throws

\Prophecy\Exception\Prophecy\ObjectProphecyException If double doesn't implement needed interface

Overrides ProphecyInterface::reveal

1 call to ObjectProphecy::reveal()
ObjectProphecy::checkProphecyMethodsPredictions in vendor/phpspec/prophecy/src/Prophecy/Prophecy/ObjectProphecy.php
Checks that registered method predictions do not fail.

File

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

Class

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

Namespace

Prophecy\Prophecy

Code

public function reveal() {
    $double = $this->lazyDouble
        ->getInstance();
    if (!$double instanceof ProphecySubjectInterface) {
        throw new ObjectProphecyException("Generated double must implement ProphecySubjectInterface, but it does not.\n" . 'It seems you have wrongly configured doubler without required ClassPatch.', $this);
    }
    $double->setProphecy($this);
    return $double;
}
RSS feed
Powered by Drupal