/**
  * testRuleDoesNotApplyToPrivateMethodWithSuppressWarningsAnnotation
  *
  * @return void
  */
 public function testRuleDoesNotApplyToPrivateMethodWithSuppressWarningsAnnotation()
 {
     $ruleSet = new RuleSet();
     $ruleSet->addRule(new UnusedPrivateMethod());
     $ruleSet->setReport($this->getReportMock(0));
     $ruleSet->apply($this->getClass());
 }
 /**
  * testRuleSetInvokesRuleForClassInstance
  *
  * @return void
  */
 public function testRuleSetInvokesRuleForClassInstance()
 {
     $rule = new ExcessivePublicCount();
     $rule->addProperty('minimum', 3);
     $class = $this->getClass();
     $class->setMetrics(array('cis' => 4));
     $ruleSet = new RuleSet();
     $ruleSet->addRule($rule);
     $ruleSet->setReport($this->getReportMock(1));
     $ruleSet->apply($class);
 }
Beispiel #3
0
 /**
  * Creates a rule set instance with a variable amount of appended rule
  * objects.
  *
  * @param string $name
  * @return \PHPMD\AbstractRule
  */
 private function createRuleSetFixture($name = null)
 {
     $ruleSet = new RuleSet();
     for ($i = 0; $i < func_num_args(); ++$i) {
         $rule = new RuleStub(func_get_arg($i));
         $ruleSet->addRule($rule);
     }
     return $ruleSet;
 }
 /**
  * testRuleDoesNotApplyToMethodParameterNamedArgv
  *
  * @return void
  */
 public function testRuleDoesNotApplyToMethodParameterNamedArgv()
 {
     $ruleSet = new RuleSet();
     $ruleSet->addRule(new UnusedFormalParameter());
     $ruleSet->setReport($this->getReportMock(0));
     $ruleSet->apply($this->getMethod());
 }