/**
  * 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);
 }
コード例 #2
0
 /**
  * testRuleAppliesToClassesWithMorePublicMembersThanThreshold
  *
  * @return void
  */
 public function testRuleAppliesToClassesWithMorePublicMembersThanThreshold()
 {
     $rule = new ExcessivePublicCount();
     $rule->setReport($this->getReportMock(1));
     $rule->addProperty('minimum', '23');
     $rule->apply($this->getClassMock('cis', 42));
 }