You are here

public function ObjectProphecy::reveal in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/phpspec/prophecy/src/Prophecy/Prophecy/ObjectProphecy.php \Prophecy\Prophecy\ObjectProphecy::reveal()

Reveals double.

Return value

object

Throws

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

Overrides ProphecyInterface::reveal

2 calls to ObjectProphecy::reveal()
ObjectProphecy::addMethodProphecy in vendor/phpspec/prophecy/src/Prophecy/Prophecy/ObjectProphecy.php
Adds method prophecy to object prophecy.
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 112

Class

ObjectProphecy
Object prophecy.

Namespace

Prophecy\Prophecy

Code

public function reveal() {
  $double = $this->lazyDouble
    ->getInstance();
  if (null === $double || !$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;
}