You are here

function MethodProphecySpec::it_records_checked_predictions in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpspec/prophecy/spec/Prophecy/Prophecy/MethodProphecySpec.php \spec\Prophecy\Prophecy\MethodProphecySpec::it_records_checked_predictions()

Parameters

\Prophecy\Argument\ArgumentsWildcard $arguments:

\Prophecy\Prediction\PredictionInterface $prediction1:

\Prophecy\Prediction\PredictionInterface $prediction2:

\Prophecy\Call\Call $call1:

\Prophecy\Call\Call $call2:

\Prophecy\Promise\PromiseInterface $promise:

File

vendor/phpspec/prophecy/spec/Prophecy/Prophecy/MethodProphecySpec.php, line 256

Class

MethodProphecySpec

Namespace

spec\Prophecy\Prophecy

Code

function it_records_checked_predictions($objectProphecy, $arguments, $prediction1, $prediction2, $call1, $call2, $promise) {
  $objectProphecy
    ->addMethodProphecy($this)
    ->willReturn(null);
  $prediction1
    ->check(array(
    $call1,
    $call2,
  ), $objectProphecy
    ->getWrappedObject(), $this)
    ->willReturn();
  $prediction2
    ->check(array(
    $call1,
    $call2,
  ), $objectProphecy
    ->getWrappedObject(), $this)
    ->willReturn();
  $objectProphecy
    ->findProphecyMethodCalls('getName', $arguments)
    ->willReturn(array(
    $call1,
    $call2,
  ));
  $this
    ->will($promise);
  $this
    ->withArguments($arguments);
  $this
    ->callOnWrappedObject('shouldHave', array(
    $prediction1,
  ));
  $this
    ->callOnWrappedObject('shouldHave', array(
    $prediction2,
  ));
  $this
    ->getCheckedPredictions()
    ->shouldReturn(array(
    $prediction1,
    $prediction2,
  ));
}