/** * @covers \spriebsch\PHPca\Rule\MaximumLineLengthRule */ public function testTabsCountAsFourCharactersTowardsLengthPass() { $this->init(__DIR__ . '/../_testdata/MaximumLineLengthRule/tabbed_over_pass.php'); $rule = new MaximumLineLengthRule(); $conf = new Configuration(""); $conf->setLineEndings("\n"); $rule->setConfiguration($conf); $rule->configure(array("line_length" => 100)); $rule->check($this->file, $this->result); $this->assertFalse($this->result->hasViolations()); }
/** * @covers \spriebsch\PHPca\Rule\NoCarriageReturnsRule */ public function testCarriageReturns() { $this->init(__DIR__ . '/../_testdata/NoCarriageReturnsRule/carriagereturns.php'); $configuration = new Configuration(__DIR__); $configuration->setLineEndings("\n"); $rule = new NoCarriageReturnsRule(); $rule->setConfiguration($configuration); $rule->check($this->file, $this->result); $this->assertEquals(26, $this->result->getNumberOfViolations()); }