Skip to content

Commit

Permalink
fixup! remove dom as unused
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Dec 16, 2023
1 parent 9ed04f5 commit 967bbce
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions tests/Converter/ConfigFormatConverter/YamlToPhp/YamlToPhpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ final class YamlToPhpTest extends AbstractTestCase
protected function setUp(): void
{
parent::setUp();

$this->configFormatConverter = $this->getService(ConfigFormatConverter::class);
}

Expand All @@ -32,9 +31,6 @@ public function testRouting(SplFileInfo $fileInfo): void
$this->doTestOutput($fileInfo, true);
}

/**
* @return Iterator<mixed, \SplFileInfo[]>
*/
public static function provideDataForRouting(): Iterator
{
return FixtureFinder::yieldDirectory(__DIR__ . '/Fixture/routing', '*.yaml');
Expand Down Expand Up @@ -70,17 +66,11 @@ public function testNormal(SplFileInfo $fixtureFileInfo): void
$this->doTestOutput($fixtureFileInfo);
}

/**
* @return Iterator<mixed, \SplFileInfo[]>
*/
public static function provideData(): Iterator
{
return FixtureFinder::yieldDirectory(__DIR__ . '/Fixture/normal', '*.yaml');
}

/**
* @return Iterator<mixed, \SplFileInfo[]>
*/
public static function provideDataWithPhpImported(): Iterator
{
return FixtureFinder::yieldDirectory(__DIR__ . '/Fixture/skip-imported-php', '*.yaml');
Expand All @@ -90,16 +80,13 @@ private function doTestOutput(SplFileInfo $fixtureFileInfo, bool $preserveDirStr
{
$inputAndExpected = FixtureSplitter::splitFileInfoToLocalInputAndExpectedFileInfos($fixtureFileInfo, false, $preserveDirStructure);

$this->doTestFileInfo($inputAndExpected->getInputFileInfo(), $inputAndExpected->getExpectedFileContent(), $fixtureFileInfo);
}

private function doTestFileInfo(SplFileInfo $inputFileInfo, string $expectedContent, SplFileInfo $fixtureFileInfo): void
{
$inputFileInfo = $inputAndExpected->getInputFileInfo();
$convertedContent = $this->configFormatConverter->convert($inputFileInfo);

// run `UT=1 vendor/bin/phpunit` to update test fixtures content
FixtureUpdater::updateFixtureContent($inputFileInfo, $convertedContent, $fixtureFileInfo);

$filePath = RelativeFilePathHelper::resolveFromDirectory($fixtureFileInfo->getRealPath(), getcwd());

$this->assertSame($expectedContent, $convertedContent, $filePath);
$this->assertSame($inputAndExpected->getExpectedFileContent(), $convertedContent, $filePath);
}
}

0 comments on commit 967bbce

Please sign in to comment.