/** * 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_LongMethod * @group phpmd * @group phpmd::rule * @group phpmd::rule::design * @group unittest */ public function testRuleDoesNotApplyForValueLowerThanThreshold() { $method = $this->getMethodMock('loc', 22); $report = $this->getReportMock(0); $rule = new PHP_PMD_Rule_Design_LongMethod(); $rule->setReport($report); $rule->addProperty('minimum', '23'); $rule->apply($method); }
/** * 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_LongMethod(); $rule->setReport($report); $rule->addProperty('minimum', '23'); $rule->addProperty('ignore-whitespace', true); $rule->apply($class); }