You are here

function ArrayEntryTokenSpec::it_scores_traversable_object_half_of_combined_scores_from_key_and_value_tokens in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEntryTokenSpec.php \spec\Prophecy\Argument\Token\ArrayEntryTokenSpec::it_scores_traversable_object_half_of_combined_scores_from_key_and_value_tokens()

Parameters

\Prophecy\Argument\Token\TokenInterface $key:

\Prophecy\Argument\Token\TokenInterface $value:

\Iterator $object:

File

vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEntryTokenSpec.php, line 75

Class

ArrayEntryTokenSpec

Namespace

spec\Prophecy\Argument\Token

Code

function it_scores_traversable_object_half_of_combined_scores_from_key_and_value_tokens($key, $value, $object) {
  $object
    ->current()
    ->will(function () use ($object) {
    $object
      ->valid()
      ->willReturn(false);
    return 'value';
  });
  $object
    ->key()
    ->willReturn('key');
  $object
    ->rewind()
    ->willReturn(null);
  $object
    ->next()
    ->willReturn(null);
  $object
    ->valid()
    ->willReturn(true);
  $key
    ->scoreArgument('key')
    ->willReturn(6);
  $value
    ->scoreArgument('value')
    ->willReturn(2);
  $this
    ->scoreArgument($object)
    ->shouldBe(4);
}