* Dariusz RumiƄski * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Runner; use PhpCsFixer\Runner\Parallel\ParallelConfig; use PhpCsFixer\Runner\RunnerConfig; use PhpCsFixer\Tests\TestCase; /** * @internal * * @covers \PhpCsFixer\Runner\RunnerConfig */ final class RunnerConfigTest extends TestCase { /** * @dataProvider provideGettersReturnCorrectDataCases */ public function testGettersReturnCorrectData( bool $isDryRun, bool $stopOnViolation, ParallelConfig $parallelConfig, ?string $configFile = null ): void { $config = new RunnerConfig($isDryRun, $stopOnViolation, $parallelConfig, $configFile); self::assertSame($isDryRun, $config->isDryRun()); self::assertSame($stopOnViolation, $config->shouldStopOnViolation()); self::assertSame($parallelConfig, $config->getParallelConfig()); self::assertSame($configFile, $config->getConfigFile()); } /** * @return iterable */ public static function provideGettersReturnCorrectDataCases(): iterable { yield 'null config file' => [ false, false, new ParallelConfig(1, 2, 3), null, ]; yield 'config file provided' => [ false, false, new ParallelConfig(1, 2, 3), __DIR__.'/../../../.php-cs-fixer.dist.php', ]; } }