You are here

function ProphetSpec::it_throws_AggregateException_if_defined_predictions_fail in Zircon Profile 8

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

Parameters

\Prophecy\Prophecy\MethodProphecy $method1:

\Prophecy\Prophecy\MethodProphecy $method2:

\Prophecy\Argument\ArgumentsWildcard $arguments1:

\Prophecy\Argument\ArgumentsWildcard $arguments2:

File

vendor/phpspec/prophecy/spec/Prophecy/ProphetSpec.php, line 66

Class

ProphetSpec

Namespace

spec\Prophecy

Code

function it_throws_AggregateException_if_defined_predictions_fail($method1, $method2, $arguments1, $arguments2) {
  $method1
    ->getMethodName()
    ->willReturn('getName');
  $method1
    ->getArgumentsWildcard()
    ->willReturn($arguments1);
  $method1
    ->checkPrediction()
    ->willReturn(null);
  $method2
    ->getMethodName()
    ->willReturn('isSet');
  $method2
    ->getArgumentsWildcard()
    ->willReturn($arguments2);
  $method2
    ->checkPrediction()
    ->willThrow('Prophecy\\Exception\\Prediction\\AggregateException');
  $this
    ->prophesize()
    ->addMethodProphecy($method1);
  $this
    ->prophesize()
    ->addMethodProphecy($method2);
  $this
    ->shouldThrow('Prophecy\\Exception\\Prediction\\AggregateException')
    ->duringCheckPredictions();
}