You are here

function CallCenterSpec::it_finds_recorded_calls_by_a_method_name_and_arguments_wildcard in Zircon Profile 8

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

Parameters

\Prophecy\Argument\ArgumentsWildcard $wildcard:

File

vendor/phpspec/prophecy/spec/Prophecy/Call/CallCenterSpec.php, line 176

Class

CallCenterSpec

Namespace

spec\Prophecy\Call

Code

function it_finds_recorded_calls_by_a_method_name_and_arguments_wildcard($objectProphecy, $wildcard) {
  $objectProphecy
    ->getMethodProphecies()
    ->willReturn(array());
  $this
    ->makeCall($objectProphecy, 'getName', array(
    'world',
  ));
  $this
    ->makeCall($objectProphecy, 'getName', array(
    'everything',
  ));
  $this
    ->makeCall($objectProphecy, 'setName', array(
    42,
  ));
  $wildcard
    ->scoreArguments(array(
    'world',
  ))
    ->willReturn(false);
  $wildcard
    ->scoreArguments(array(
    'everything',
  ))
    ->willReturn(10);
  $calls = $this
    ->findCalls('getName', $wildcard);
  $calls
    ->shouldHaveCount(1);
  $calls[0]
    ->getMethodName()
    ->shouldReturn('getName');
  $calls[0]
    ->getArguments()
    ->shouldReturn(array(
    'everything',
  ));
}