function it_return_false_of_regexp_does_not_match(UserAgentToken $token, ConditionInterface $condition, RuleInterface $rule)
 {
     $token->__toString()->willReturn('Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.74 Safari/537.36 MRCHROME');
     $condition->getValue()->willReturn('#AppleWebKitt(?:/(?P<webkit_version>\\d+[\\.\\d]+))#is');
     $condition->getDynamicCapabilities()->shouldNotBeCalled()->willReturn(array('webkit_version'));
     $rule->getCapabilities()->willReturn(array('applewebkit' => true))->shouldNotBeCalled();
     $rule->setCapabilities(Argument::exact(array('applewebkit' => true, 'webkit_version' => '537.36')))->shouldNotBeCalled();
     $this->evaluate($token, $condition, $rule)->shouldReturn(false);
 }
 function it_return_tokens(UserAgentToken $token, UserAgentTokenizer $tokenizer)
 {
     $userAgent = 'Mozilla/5.0 (Linux; U; Android 1.0; en-us; generic) AppleWebKit/525.10 (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2';
     $token->getData()->shouldBeCalledTimes(2)->willReturn($userAgent);
     $tokenizer->tokenize(Argument::exact($userAgent))->shouldBeCalledTimes(1)->willReturn(array('mozilla', 'linux'));
     $this->beConstructedWith($token, $tokenizer);
     $this->getData()->shouldReturn(array('mozilla', 'linux'));
     $this->getData()->shouldReturn(array('mozilla', 'linux'));
     $this->__toString()->shouldReturn($userAgent);
 }
 /**
  * @return string
  */
 public function __toString()
 {
     return $this->token->getData();
 }
 function it_return_false_of_stripos_does_not_match(UserAgentToken $token, ConditionInterface $condition, RuleInterface $rule)
 {
     $token->__toString()->willReturn('Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.74 Safari/537.36 MRCHROME');
     $condition->getValue()->willReturn('AppleWebKit2');
     $this->evaluate($token, $condition, $rule)->shouldReturn(false);
 }