Chris@0: beConstructedWith(array()); Chris@0: $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface'); Chris@0: } Chris@0: Chris@0: function it_is_not_last() Chris@0: { Chris@0: $this->beConstructedWith(array()); Chris@0: $this->shouldNotBeLast(); Chris@0: } Chris@0: Chris@0: function it_generates_string_representation_from_all_tokens_imploded( Chris@0: TokenInterface $token1, Chris@0: TokenInterface $token2, Chris@0: TokenInterface $token3 Chris@0: ) { Chris@0: $token1->__toString()->willReturn('token_1'); Chris@0: $token2->__toString()->willReturn('token_2'); Chris@0: $token3->__toString()->willReturn('token_3'); Chris@0: Chris@0: $this->beConstructedWith(array($token1, $token2, $token3)); Chris@0: $this->__toString()->shouldReturn('bool(token_1 AND token_2 AND token_3)'); Chris@0: } Chris@0: Chris@0: function it_wraps_non_token_arguments_into_ExactValueToken() Chris@0: { Chris@0: $this->beConstructedWith(array(15, '1985')); Chris@0: $this->__toString()->shouldReturn("bool(exact(15) AND exact(\"1985\"))"); Chris@0: } Chris@0: Chris@0: function it_scores_the_maximum_score_from_all_scores_returned_by_tokens(TokenInterface $token1, TokenInterface $token2) Chris@0: { Chris@0: $token1->scoreArgument(1)->willReturn(10); Chris@0: $token2->scoreArgument(1)->willReturn(5); Chris@0: $this->beConstructedWith(array($token1, $token2)); Chris@0: $this->scoreArgument(1)->shouldReturn(10); Chris@0: } Chris@0: Chris@0: function it_does_not_score_if_there_are_no_arguments_or_tokens() Chris@0: { Chris@0: $this->beConstructedWith(array()); Chris@0: $this->scoreArgument('any')->shouldReturn(false); Chris@0: } Chris@0: Chris@0: function it_does_not_score_if_either_of_tokens_does_not_score(TokenInterface $token1, TokenInterface $token2) Chris@0: { Chris@0: $token1->scoreArgument(1)->willReturn(10); Chris@0: $token1->scoreArgument(2)->willReturn(false); Chris@0: Chris@0: $token2->scoreArgument(1)->willReturn(false); Chris@0: $token2->scoreArgument(2)->willReturn(10); Chris@0: Chris@0: $this->beConstructedWith(array($token1, $token2)); Chris@0: Chris@0: $this->scoreArgument(1)->shouldReturn(false); Chris@0: $this->scoreArgument(2)->shouldReturn(false); Chris@0: } Chris@0: }