diff --git a/tests/File/FileHelperTest.php b/tests/File/FileHelperTest.php index f31671af..b7653765 100644 --- a/tests/File/FileHelperTest.php +++ b/tests/File/FileHelperTest.php @@ -9,6 +9,26 @@ final class FileHelperTest extends TestCase { + /** + * @dataProvider detectEOLDataProvider + */ + public function testDetectEOL( + string $content, + string $expected, + ): void { + static::assertSame($expected, FileHelper::detectEOL($content)); + } + + /** + * @return iterable + */ + public static function detectEOLDataProvider(): iterable + { + yield ['foo', \PHP_EOL]; + yield ["foo\n", "\n"]; + yield ["foo\r\n", "\r\n"]; + } + /** * @dataProvider removeDotDataProvider */ diff --git a/tests/Ruleset/RulesetTest.php b/tests/Ruleset/RulesetTest.php index a26cb3a0..4fee3c42 100644 --- a/tests/Ruleset/RulesetTest.php +++ b/tests/Ruleset/RulesetTest.php @@ -69,5 +69,8 @@ protected function process(int $tokenPosition, array $tokens): void $ruleset->allowNonFixableRules(false); static::assertCount(1, $ruleset->getRules()); + + $ruleset->allowNonFixableRules(); + static::assertCount(2, $ruleset->getRules()); } }