/** * Tests that the rule uses eloc when ignore whitespace is set * * @return void */ public function testRuleUsesElocWhenIgnoreWhitespaceSet() { $class = $this->getClassMock('eloc', 22); $report = $this->getReportMock(0); $rule = new PHP_PMD_Rule_Design_LongClass(); $rule->setReport($report); $rule->addProperty('minimum', '23'); $rule->addProperty('ignore-whitespace', true); $rule->apply($class); }
/** * Tests that the rule does not apply when the value is at least one lower * than the threshold. * * @return void * @covers PHP_PMD_Rule_Design_LongClass * @group phpmd * @group phpmd::rule * @group phpmd::rule::design * @group unittest */ public function testRuleDoesNotApplyForValueLowerThanThreshold() { $class = $this->getClassMock('loc', 22); $report = $this->getReportMock(0); $rule = new PHP_PMD_Rule_Design_LongClass(); $rule->setReport($report); $rule->addProperty('minimum', '23'); $rule->apply($class); }