Skip to content

Commit

Permalink
Add more tests (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet authored Feb 26, 2024
1 parent b66e89b commit 06405a8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/File/FileHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<array-key, array{string, string}>
*/
public static function detectEOLDataProvider(): iterable
{
yield ['foo', \PHP_EOL];
yield ["foo\n", "\n"];
yield ["foo\r\n", "\r\n"];
}

/**
* @dataProvider removeDotDataProvider
*/
Expand Down
3 changes: 3 additions & 0 deletions tests/Ruleset/RulesetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

0 comments on commit 06405a8

Please sign in to comment.