boot(); $this->yamlFileFormatter = $this->getService(YamlFileFormatter::class); } /** * @dataProvider provideData() */ public function test(SmartFileInfo $fileInfo): void { $this->doTestFileInfo($fileInfo); } /** * @return Iterator> */ public function provideData(): Iterator { return StaticFixtureFinder::yieldDirectory(__DIR__ . '/Fixture', '*.yaml'); } private function doTestFileInfo(SmartFileInfo $smartFileInfo): void { $inputFileInfoAndExpected = StaticFixtureSplitter::splitFileInfoToLocalInputAndExpected($smartFileInfo); $inputFileInfo = $inputFileInfoAndExpected->getInputFileInfo(); $file = new File($inputFileInfo, $inputFileInfo->getContents()); $editorConfigConfigurationBuilder = new EditorConfigConfigurationBuilder(); $editorConfigConfigurationBuilder->withIndent(Indent::createSpaceWithSize(4)); $editorConfigConfigurationBuilder->withInsertFinalNewline(false); $this->yamlFileFormatter->format($file, $editorConfigConfigurationBuilder->build()); $this->assertSame($inputFileInfoAndExpected->getExpected(), $file->getFileContent()); } }