Skip to content

Commit 04c5476

Browse files
committed
Moved CompoundFixerTest runner to static instance
1 parent 5f7a8c8 commit 04c5476

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

tests/CompoundFixerTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,23 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Polymorphine\Dev\FixerFactory;
16-
use Polymorphine\Dev\Tests\Fixtures\FixerTestRunner;
1716

1817

1918
/** @group integrated */
2019
class CompoundFixerTest extends TestCase
2120
{
22-
private FixerTestRunner $runner;
21+
private static Fixtures\FixerTestRunner $runner;
2322

24-
protected function setUp(): void
23+
public static function setUpBeforeClass(): void
2524
{
2625
$config = FixerFactory::createFor(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'cs-fixer.php.dist');
27-
$this->runner = FixerTestRunner::withConfig($config);
26+
self::$runner = Fixtures\FixerTestRunner::withConfig($config);
2827
}
2928

3029
/** @dataProvider fileList */
3130
public function test_FixedFiles_MatchExpectations(string $fileExpected, string $fileGiven)
3231
{
33-
$sourceCode = file_get_contents($fileGiven);
34-
$this->assertSame(file_get_contents($fileExpected), $this->runner->fix($sourceCode));
32+
self::assertSame(file_get_contents($fileExpected), self::$runner->fix(file_get_contents($fileGiven)));
3533
}
3634

3735
public static function fileList(): iterable

0 commit comments

Comments
 (0)