예제 #1
0
 protected function getLimits($testClassName, $methodName)
 {
     /** @var \Phprtest\Annotations\AssertAnnotation $annotations */
     $annotations = $this->annotations->getMethodAnnotations($testClassName, $methodName, '@assert');
     $limits = array();
     if (count($annotations)) {
         foreach ($annotations as $annotation) {
             $limits[$annotation->metric] = array('softLimit' => $annotation->softLimit, 'hardLimit' => $annotation->hardLimit);
         }
     }
     return $limits;
 }
 protected function testOrphanedAnnotationsAreIgnored()
 {
     $manager = new AnnotationManager();
     $manager->namespace = 'mindplay\\test\\Sample';
     $manager->cache = false;
     /** @var Annotation[] $annotations */
     $annotations = $manager->getMethodAnnotations('mindplay\\test\\Sample\\OrphanedAnnotations', 'someMethod');
     $this->check(count($annotations) == 1, 'the @return annotation was found');
     $this->check($annotations[0] instanceof ReturnAnnotation, 'the @return annotation has correct type');
 }