/**
  * @dataProvider matchesDataProvider
  */
 public function testMatches($annotations, $url, $expected_matches)
 {
     $parsed_annotations = array();
     foreach ($annotations as $annotation_params) {
         $parsed_annotations[] = $this->createAnnotation($annotation_params);
     }
     $this->assertEquals($expected_matches, $this->pageUrlMatcher->matches($url, $parsed_annotations));
 }
 /**
  * Adds a page url matcher instance.
  *
  * @param IPageUrlMatcher $page_url_matcher Page url matcher.
  *
  * @return self
  * @throws PageUrlMatcherException When page url matcher with same priority is already registered.
  */
 public function add(IPageUrlMatcher $page_url_matcher)
 {
     $priority = (string) $page_url_matcher->getPriority();
     if (isset($this->matchers[$priority])) {
         throw new PageUrlMatcherException('The page url matcher with "' . $priority . '" priority is already registered.', PageUrlMatcherException::TYPE_DUPLICATE_PRIORITY);
     }
     $this->matchers[$priority] = $page_url_matcher;
     $this->annotationManager->registry[$page_url_matcher->getAnnotationName()] = $page_url_matcher->getAnnotationClass();
     krsort($this->matchers, SORT_NUMERIC);
     return $this;
 }