Skip to content

Commit

Permalink
simplify test set
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Dec 16, 2023
1 parent f8f7c66 commit 5945627
Show file tree
Hide file tree
Showing 27 changed files with 0 additions and 170 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

56 changes: 0 additions & 56 deletions tests/Converter/ConfigFormatConverter/YamlToPhp/YamlToPhpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,38 +70,6 @@ public function testNormal(SplFileInfo $fixtureFileInfo): void
$this->doTestOutput($fixtureFileInfo);
}

#[DataProvider('provideDataWithDirectory')]
public function testSpecialCaseWithDirectory(SplFileInfo $fileInfo): void
{
$this->doTestOutputWithExtraDirectory($fileInfo, __DIR__ . '/Fixture/nested');
}

#[DataProvider('provideDataExtension')]
public function testEcs(SplFileInfo $fileInfo): void
{
$this->doTestOutputWithExtraDirectory($fileInfo, $fileInfo->getPath());
}

/**
* @source https://github.com/symfony/maker-bundle/pull/604
*/
#[DataProvider('provideDataMakerBundle')]
public function testMakerBundle(SplFileInfo $fileInfo): void
{
// needed for all the included
$temporaryPath = FixtureSplitter::getTemporaryPath();
FileSystem::write(
$temporaryPath . '/../src/SomeClass.php',
'<?php namespace App { class SomeClass {} }'
);
require_once $temporaryPath . '/../src/SomeClass.php';

FileSystem::createDir($temporaryPath . '/../src/Controller');
FileSystem::createDir($temporaryPath . '/../src/Domain');

$this->doTestOutput($fileInfo);
}

/**
* @return Iterator<mixed, \SplFileInfo[]>
*/
Expand All @@ -118,30 +86,6 @@ public static function provideDataWithPhpImported(): Iterator
return FixtureFinder::yieldDirectory(__DIR__ . '/Fixture/skip-imported-php', '*.yaml');
}

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

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

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

private function doTestOutput(SplFileInfo $fixtureFileInfo, bool $preserveDirStructure = false): void
{
$inputAndExpected = FixtureSplitter::splitFileInfoToLocalInputAndExpectedFileInfos($fixtureFileInfo, false, $preserveDirStructure);
Expand Down

0 comments on commit 5945627

Please sign in to comment.