Skip to content

Commit bacc673

Browse files
authored
Fix linting (#1016)
1 parent b626cdc commit bacc673

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

tests/Fixer/AbstractFixerTestCase.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ final protected function doTest(string $expected, ?string $input = null, ?array
180180
$expectedTokens = Tokens::fromCode($expected);
181181

182182
if ($input !== null) {
183+
self::assertNull($this->lintSource($input));
184+
183185
Tokens::clearCache();
184186
$inputTokens = Tokens::fromCode($input);
185187

@@ -225,7 +227,7 @@ final protected function lintSource(string $source): ?string
225227
static $linter;
226228

227229
if ($linter === null) {
228-
$linter = \getenv('FAST_LINT_TEST_CASES') !== false ? new Linter() : new ProcessLinter();
230+
$linter = \getenv('FAST_LINT_TEST_CASES') === '1' ? new Linter() : new ProcessLinter();
229231
}
230232

231233
try {

tests/Fixer/NoDuplicatedImportsFixerTest.php

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ public function testIsRisky(): void
2828
*/
2929
public function testFix(string $expected, ?string $input = null): void
3030
{
31+
if (\getenv('FAST_LINT_TEST_CASES') !== '1') {
32+
self::markTestSkipped('Duplicated imports can be tested only if FAST_LINT_TEST_CASES is enabled.');
33+
}
3134
$this->doTest($expected, $input);
3235
}
3336

0 commit comments

Comments
 (0)