Author: Manuel Pichler (mapi@phpmd.org)
Ejemplo n.º 1
0
 /**
  * Checks if this node has a suppressed annotation for the given rule
  * instance.
  *
  * @param \PHPMD\Rule $rule
  * @return boolean
  */
 public function hasSuppressWarningsAnnotationFor(Rule $rule)
 {
     if ($this->annotations === null) {
         $this->annotations = new Annotations($this);
     }
     return $this->annotations->suppresses($rule);
 }
Ejemplo n.º 2
0
 /**
  * testCollectionReturnsTrueWhenOneMatchingAnnotationExists
  *
  * @return void
  */
 public function testCollectionReturnsTrueWhenOneMatchingAnnotationExists()
 {
     $class = $this->getClassMock();
     $class->expects($this->once())->method('__call')->with($this->equalTo('getDocComment'))->will($this->returnValue('/**
                   * @SuppressWarnings("FooBar")
                   * @SuppressWarnings("PMD")
                   */'));
     $annotations = new Annotations($class);
     $this->assertTrue($annotations->suppresses($this->getRuleMock()));
 }