示例#1
0
 /**
  * Sets expectation for regexp url match annotations and returns them.
  *
  * @param AnnotationManager $annotation_manager The annotation manager.
  * @param array             $annotations_data   Url match.
  *
  * @return array
  */
 protected function expectMatchUrlRegexpAnnotation(Page $page, $annotations_data = array())
 {
     $annotations = array();
     foreach ($annotations_data as $annotation_params) {
         $annotation = new MatchUrlRegexpAnnotation();
         $annotation->initAnnotation($annotation_params);
         $annotations[] = $annotation;
     }
     $this->annotationManager->shouldReceive('getClassAnnotations')->with($page, '@match-url-regexp')->andReturn($annotations);
     return $annotations;
 }
 public function testInvalidAnnotation()
 {
     $annotation = new MatchUrlRegexpAnnotation();
     $this->assertFalse($annotation->isValid());
 }
 /**
  * Creates annotation instance, that matcher will use.
  *
  * @param array $parameters Parameters.
  *
  * @return MatchUrlRegexpAnnotation
  */
 public function createAnnotation(array $parameters)
 {
     $annotation = new MatchUrlRegexpAnnotation();
     $annotation->initAnnotation($parameters);
     return $annotation;
 }