Example #1
0
 public function testMatchMustReturnFirstMatch()
 {
     $expected = 'aaa bbb 1';
     $needle = 'aaa bbb 4';
     $candidates = array('aaa bbb 1', 'aaa bbb 2', 'aaa bbb 3', 'aaa bbb 5', 'aaa bbb 6');
     $match = $this->risMatcher->match($candidates, $needle, 1);
     self::assertEquals($expected, $match);
 }
Example #2
0
 /**
  * Alias of \Wurfl\Handlers\Matcher\RISMatcher::match()
  *
  * @param array  $collection
  * @param string $needle
  * @param int    $tolerance
  *
  * @return string Matched user agent
  * @see \Wurfl\Handlers\Matcher\RISMatcher::match()
  */
 public static function risMatch($collection, $needle, $tolerance)
 {
     return Matcher\RISMatcher::getInstance()->match($collection, $needle, $tolerance);
 }