You are here

function ObjectProphecySpec::its_addMethodProphecy_handles_prophecies_with_different_arguments in Zircon Profile 8

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

Parameters

\Prophecy\Prophecy\MethodProphecy $methodProphecy1:

\Prophecy\Prophecy\MethodProphecy $methodProphecy2:

\Prophecy\Argument\ArgumentsWildcard $argumentsWildcard1:

\Prophecy\Argument\ArgumentsWildcard $argumentsWildcard2:

File

vendor/phpspec/prophecy/spec/Prophecy/Prophecy/ObjectProphecySpec.php, line 148

Class

ObjectProphecySpec

Namespace

spec\Prophecy\Prophecy

Code

function its_addMethodProphecy_handles_prophecies_with_different_arguments($methodProphecy1, $methodProphecy2, $argumentsWildcard1, $argumentsWildcard2) {
  $methodProphecy1
    ->getArgumentsWildcard()
    ->willReturn($argumentsWildcard1);
  $methodProphecy1
    ->getMethodName()
    ->willReturn('getUsername');
  $methodProphecy2
    ->getArgumentsWildcard()
    ->willReturn($argumentsWildcard2);
  $methodProphecy2
    ->getMethodName()
    ->willReturn('getUsername');
  $this
    ->addMethodProphecy($methodProphecy1);
  $this
    ->addMethodProphecy($methodProphecy2);
  $this
    ->getMethodProphecies()
    ->shouldReturn(array(
    'getUsername' => array(
      $methodProphecy1,
      $methodProphecy2,
    ),
  ));
}