From c5b3ac7f48927723ed706929a8be5bc91d035cf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=A4u=C3=9Fler?= Date: Wed, 7 Dec 2022 12:12:10 +0100 Subject: [PATCH] [FEATURE] Introduce target file support for processed source files This commit introduces a new schema configuration "target" for file conditions within step configuration for processed source files and processed shared source files. It allows to override the default path determination behavior, e.g. when multiple files exist as source files, while they should have the same target name, depending on a given file condition. Example: Two source files `LICENSE.GPL-2.0.txt` and `LICENSE.GPL-3.0.txt` exist. Both files must be named `LICENSE.txt` in the resulting project. The file processing itself depends on given conditions: If the user selects "GPL 2.0" as license, `LICENSE.GPL-2.0.txt` will be processed, if "GPL 3.0" is selected, `LICENSE.GPL-3.0.txt` will be processed. Example configuration: steps: - type: processSourceFiles fileConditions: - path: 'LICENSE.GPL-2.0.txt' if: 'license == "GPL-2.0"' target: 'LICENSE.txt' - path: 'LICENSE.GPL-3.0.txt' if: 'license == "GPL-3.0"' target: 'LICENSE.txt' --- resources/config.schema.json | 4 ++ .../Config/ValueObject/FileCondition.php | 6 +++ .../Step/ProcessSharedSourceFilesStep.php | 2 +- .../Generator/Step/ProcessSourceFilesStep.php | 2 +- .../Generator/Step/ProcessingFilesTrait.php | 13 +++++++ src/Builder/Writer/GenericFileWriter.php | 12 ++++-- src/Builder/Writer/TemplateWriter.php | 3 +- src/Builder/Writer/WriterInterface.php | 6 ++- .../src/Builder/Config/ConfigFactoryTest.php | 2 + .../Config/ValueObject/FileConditionTest.php | 10 ++++- .../Step/ProcessSharedSourceFilesStepTest.php | 7 +++- .../Step/ProcessSourceFilesStepTest.php | 7 +++- .../Builder/Writer/GenericFileWriterTest.php | 21 ++++++++++ .../src/Builder/Writer/TemplateWriterTest.php | 38 ++++++++++++++++++- .../Templates/json-template/config.json | 10 +++++ .../templates/src/shared-dummy-2.json | 3 ++ .../templates/src/shared-dummy-3.json | 3 ++ .../templates/src/shared-dummy-4.json | 3 ++ .../templates/src/shared-dummy.json.twig | 3 ++ .../templates/src/shared-dummy.yaml.twig | 1 - .../json-template/templates/src/dummy-4.json | 3 ++ .../Templates/yaml-template/config.yaml | 6 +++ .../templates/src/shared-dummy-4.yaml} | 0 .../templates/src/dummy-4.yaml} | 0 24 files changed, 151 insertions(+), 14 deletions(-) create mode 100644 tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy-2.json create mode 100644 tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy-3.json create mode 100644 tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy-4.json create mode 100644 tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy.json.twig delete mode 100644 tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy.yaml.twig create mode 100644 tests/src/Fixtures/Templates/json-template/templates/src/dummy-4.json rename tests/src/Fixtures/Templates/{json-template/templates/shared/shared-dummy/templates/src/shared-dummy-2.yaml => yaml-template/templates/shared/shared-dummy/templates/src/shared-dummy-4.yaml} (100%) rename tests/src/Fixtures/Templates/{json-template/templates/shared/shared-dummy/templates/src/shared-dummy-3.yaml => yaml-template/templates/src/dummy-4.yaml} (100%) diff --git a/resources/config.schema.json b/resources/config.schema.json index 8b6bafae..52363161 100644 --- a/resources/config.schema.json +++ b/resources/config.schema.json @@ -289,6 +289,10 @@ "path": { "type": "string", "title": "Relative path to a file, can contain symbols processable by `fnmatch`" + }, + "target": { + "type": "string", + "title": "Relative path to target file, can be used to override the default path" } }, "additionalProperties": false, diff --git a/src/Builder/Config/ValueObject/FileCondition.php b/src/Builder/Config/ValueObject/FileCondition.php index 1d788a9e..41df2037 100644 --- a/src/Builder/Config/ValueObject/FileCondition.php +++ b/src/Builder/Config/ValueObject/FileCondition.php @@ -36,6 +36,7 @@ final class FileCondition public function __construct( private string $path, string $if, + private ?string $target = null, ) { $this->if = $if; } @@ -44,4 +45,9 @@ public function getPath(): string { return $this->path; } + + public function getTarget(): ?string + { + return $this->target; + } } diff --git a/src/Builder/Generator/Step/ProcessSharedSourceFilesStep.php b/src/Builder/Generator/Step/ProcessSharedSourceFilesStep.php index b54aef5e..239bfd35 100644 --- a/src/Builder/Generator/Step/ProcessSharedSourceFilesStep.php +++ b/src/Builder/Generator/Step/ProcessSharedSourceFilesStep.php @@ -64,7 +64,7 @@ public function run(Builder\BuildResult $buildResult): bool ); $writer = $this->writerFactory->get($sharedSourceFile->getPathname()); - $processedFile = $writer->write($instructions, $sharedSourceFile); + $processedFile = $writer->write($instructions, $sharedSourceFile, $this->findTargetFile($sharedSourceFile)); $this->processedFiles[] = new Resource\Local\ProcessedFile($sharedSourceFile, $processedFile); diff --git a/src/Builder/Generator/Step/ProcessSourceFilesStep.php b/src/Builder/Generator/Step/ProcessSourceFilesStep.php index c893815f..e408ae94 100644 --- a/src/Builder/Generator/Step/ProcessSourceFilesStep.php +++ b/src/Builder/Generator/Step/ProcessSourceFilesStep.php @@ -63,7 +63,7 @@ public function run(Builder\BuildResult $buildResult): bool ); $writer = $this->writerFactory->get($sourceFile->getPathname()); - $processedFile = $writer->write($instructions, $sourceFile); + $processedFile = $writer->write($instructions, $sourceFile, $this->findTargetFile($sourceFile)); $this->processedFiles[] = new Resource\Local\ProcessedFile($sourceFile, $processedFile); diff --git a/src/Builder/Generator/Step/ProcessingFilesTrait.php b/src/Builder/Generator/Step/ProcessingFilesTrait.php index 0320f80e..01e46402 100644 --- a/src/Builder/Generator/Step/ProcessingFilesTrait.php +++ b/src/Builder/Generator/Step/ProcessingFilesTrait.php @@ -29,6 +29,8 @@ use Symfony\Component\Filesystem; use Symfony\Component\Finder; +use function fnmatch; + /** * ProcessingFilesTrait. * @@ -78,4 +80,15 @@ protected function shouldProcessFile(Finder\SplFileInfo $file, Builder\BuildInst return true; } + + protected function findTargetFile(Finder\SplFileInfo $file): ?string + { + foreach ($this->config->getOptions()->getFileConditions() as $fileCondition) { + if (fnmatch($fileCondition->getPath(), $file->getRelativePathname())) { + return $fileCondition->getTarget(); + } + } + + return null; + } } diff --git a/src/Builder/Writer/GenericFileWriter.php b/src/Builder/Writer/GenericFileWriter.php index 51b25012..1351a403 100644 --- a/src/Builder/Writer/GenericFileWriter.php +++ b/src/Builder/Writer/GenericFileWriter.php @@ -41,10 +41,16 @@ public function __construct( ) { } - public function write(Builder\BuildInstructions $instructions, Finder\SplFileInfo $file): Finder\SplFileInfo - { + public function write( + Builder\BuildInstructions $instructions, + Finder\SplFileInfo $file, + ?string $targetFile = null, + ): Finder\SplFileInfo { $targetDirectory = $instructions->getTemporaryDirectory(); - $targetFile = Helper\FilesystemHelper::createFileObject($targetDirectory, $file->getRelativePathname()); + $targetFile = Helper\FilesystemHelper::createFileObject( + $targetDirectory, + $targetFile ?? $file->getRelativePathname(), + ); $this->filesystem->copy($file->getPathname(), $targetFile->getPathname()); diff --git a/src/Builder/Writer/TemplateWriter.php b/src/Builder/Writer/TemplateWriter.php index 50e28062..d2e6dee0 100644 --- a/src/Builder/Writer/TemplateWriter.php +++ b/src/Builder/Writer/TemplateWriter.php @@ -49,13 +49,14 @@ public function __construct( public function write( Builder\BuildInstructions $instructions, Finder\SplFileInfo $file, + ?string $targetFile = null, array $variables = [], ): Finder\SplFileInfo { $renderer = $this->renderer->withRootPath($file->getPath()); $renderResult = $renderer->render($instructions, $file->getFilename(), $variables); $targetFile = Helper\FilesystemHelper::createFileObject( $instructions->getTemporaryDirectory(), - (string) preg_replace('/\.twig$/', '', $file->getRelativePathname()), + $targetFile ?? (string) preg_replace('/\.twig$/', '', $file->getRelativePathname()), ); $this->filesystem->dumpFile($targetFile->getPathname(), $renderResult); diff --git a/src/Builder/Writer/WriterInterface.php b/src/Builder/Writer/WriterInterface.php index 06c8ac73..7bad8002 100644 --- a/src/Builder/Writer/WriterInterface.php +++ b/src/Builder/Writer/WriterInterface.php @@ -34,7 +34,11 @@ */ interface WriterInterface { - public function write(Builder\BuildInstructions $instructions, Finder\SplFileInfo $file): Finder\SplFileInfo; + public function write( + Builder\BuildInstructions $instructions, + Finder\SplFileInfo $file, + ?string $targetFile = null, + ): Finder\SplFileInfo; public static function supports(string $file): bool; } diff --git a/tests/src/Builder/Config/ConfigFactoryTest.php b/tests/src/Builder/Config/ConfigFactoryTest.php index 3b2baea8..5a0281ba 100644 --- a/tests/src/Builder/Config/ConfigFactoryTest.php +++ b/tests/src/Builder/Config/ConfigFactoryTest.php @@ -82,6 +82,7 @@ public function buildFromFileReturnsHydratedConfigObject(): void new Src\Builder\Config\ValueObject\StepOptions([ new Src\Builder\Config\ValueObject\FileCondition('dummy-2.'.$type, 'false'), new Src\Builder\Config\ValueObject\FileCondition('*-3.'.$type, 'false'), + new Src\Builder\Config\ValueObject\FileCondition('dummy-4.'.$type, 'true', 'overrides/dummy-4.'.$type), ]), ), new Src\Builder\Config\ValueObject\Step( @@ -89,6 +90,7 @@ public function buildFromFileReturnsHydratedConfigObject(): void new Src\Builder\Config\ValueObject\StepOptions([ new Src\Builder\Config\ValueObject\FileCondition('shared-dummy-2.'.$type, 'false'), new Src\Builder\Config\ValueObject\FileCondition('shared-*-3.'.$type, 'false'), + new Src\Builder\Config\ValueObject\FileCondition('shared-dummy-4.'.$type, 'true', 'overrides/shared-dummy-4.'.$type), ]), ), new Src\Builder\Config\ValueObject\Step('mirrorProcessedFiles'), diff --git a/tests/src/Builder/Config/ValueObject/FileConditionTest.php b/tests/src/Builder/Config/ValueObject/FileConditionTest.php index 243f18f3..ac058409 100644 --- a/tests/src/Builder/Config/ValueObject/FileConditionTest.php +++ b/tests/src/Builder/Config/ValueObject/FileConditionTest.php @@ -39,7 +39,7 @@ final class FileConditionTest extends TestCase protected function setUp(): void { - $this->subject = new Src\Config\ValueObject\FileCondition('foo', 'bar'); + $this->subject = new Src\Config\ValueObject\FileCondition('foo', 'bar', 'target'); } /** @@ -76,4 +76,12 @@ public function conditionMatchesChecksIfConditionMatches(): void self::assertFalse($this->subject->conditionMatches($expressionLanguage, ['bar' => false])); self::assertTrue($this->subject->conditionMatches($expressionLanguage, ['bar' => true])); } + + /** + * @test + */ + public function getTargetReturnsTarget(): void + { + self::assertSame('target', $this->subject->getTarget()); + } } diff --git a/tests/src/Builder/Generator/Step/ProcessSharedSourceFilesStepTest.php b/tests/src/Builder/Generator/Step/ProcessSharedSourceFilesStepTest.php index 458c4a79..d5a6e392 100644 --- a/tests/src/Builder/Generator/Step/ProcessSharedSourceFilesStepTest.php +++ b/tests/src/Builder/Generator/Step/ProcessSharedSourceFilesStepTest.php @@ -56,11 +56,14 @@ public function runProcessesSourceFilesAndAppliesStep(): void $actual = $this->subject->run($this->result); self::assertTrue($actual); - self::assertCount(1, $this->subject->getProcessedFiles()); - self::assertSame('shared-dummy.yaml', $this->subject->getProcessedFiles()[0]->getTargetFile()->getRelativePathname()); + self::assertCount(2, $this->subject->getProcessedFiles()); + self::assertSame('overrides/shared-dummy-4.yaml', $this->subject->getProcessedFiles()[0]->getTargetFile()->getRelativePathname()); + self::assertSame('shared-dummy.yaml', $this->subject->getProcessedFiles()[1]->getTargetFile()->getRelativePathname()); self::assertFileExists($this->result->getInstructions()->getTemporaryDirectory().'/shared-dummy.yaml'); self::assertFileDoesNotExist($this->result->getInstructions()->getTemporaryDirectory().'/shared-dummy-2.yaml'); self::assertFileDoesNotExist($this->result->getInstructions()->getTemporaryDirectory().'/shared-dummy-3.yaml'); + self::assertFileDoesNotExist($this->result->getInstructions()->getTemporaryDirectory().'/shared-dummy-4.yaml'); + self::assertFileExists($this->result->getInstructions()->getTemporaryDirectory().'/overrides/shared-dummy-4.yaml'); self::assertTrue($this->result->isStepApplied($this->subject)); } diff --git a/tests/src/Builder/Generator/Step/ProcessSourceFilesStepTest.php b/tests/src/Builder/Generator/Step/ProcessSourceFilesStepTest.php index 4c2130fa..6be860d3 100644 --- a/tests/src/Builder/Generator/Step/ProcessSourceFilesStepTest.php +++ b/tests/src/Builder/Generator/Step/ProcessSourceFilesStepTest.php @@ -56,11 +56,14 @@ public function runProcessesSourceFilesAndAppliesStep(): void $actual = $this->subject->run($this->result); self::assertTrue($actual); - self::assertCount(1, $this->subject->getProcessedFiles()); - self::assertSame('dummy.yaml', $this->subject->getProcessedFiles()[0]->getTargetFile()->getRelativePathname()); + self::assertCount(2, $this->subject->getProcessedFiles()); + self::assertSame('overrides/dummy-4.yaml', $this->subject->getProcessedFiles()[0]->getTargetFile()->getRelativePathname()); + self::assertSame('dummy.yaml', $this->subject->getProcessedFiles()[1]->getTargetFile()->getRelativePathname()); self::assertFileExists($this->result->getInstructions()->getTemporaryDirectory().'/dummy.yaml'); self::assertFileDoesNotExist($this->result->getInstructions()->getTemporaryDirectory().'/dummy-2.yaml'); self::assertFileDoesNotExist($this->result->getInstructions()->getTemporaryDirectory().'/dummy-3.yaml'); + self::assertFileDoesNotExist($this->result->getInstructions()->getTemporaryDirectory().'/dummy-4.yaml'); + self::assertFileExists($this->result->getInstructions()->getTemporaryDirectory().'/overrides/dummy-4.yaml'); self::assertTrue($this->result->isStepApplied($this->subject)); } diff --git a/tests/src/Builder/Writer/GenericFileWriterTest.php b/tests/src/Builder/Writer/GenericFileWriterTest.php index 2bff0050..15081592 100644 --- a/tests/src/Builder/Writer/GenericFileWriterTest.php +++ b/tests/src/Builder/Writer/GenericFileWriterTest.php @@ -66,4 +66,25 @@ public function writeCopiesGivenFileToTemporaryDirectory(): void (new Filesystem\Filesystem())->remove(dirname($expected)); } + + /** + * @test + */ + public function writeCopiesGivenFileToGivenTargetFile(): void + { + $instructions = new Src\Builder\BuildInstructions( + self::$container->get('app.config'), + 'foo', + ); + $sourceFile = __FILE__; + $file = new Finder\SplFileInfo($sourceFile, dirname($sourceFile), basename($sourceFile)); + + $expected = $instructions->getTemporaryDirectory().'/overrides/foo.php'; + $actual = $this->subject->write($instructions, $file, 'overrides/foo.php'); + + self::assertSame($expected, $actual->getPathname()); + self::assertFileExists($expected); + + (new Filesystem\Filesystem())->remove(dirname($expected)); + } } diff --git a/tests/src/Builder/Writer/TemplateWriterTest.php b/tests/src/Builder/Writer/TemplateWriterTest.php index f444724c..ce19d7ab 100644 --- a/tests/src/Builder/Writer/TemplateWriterTest.php +++ b/tests/src/Builder/Writer/TemplateWriterTest.php @@ -62,7 +62,43 @@ public function writeWritesRenderedTemplateFileToTemporaryDirectory(): void $file = new Finder\SplFileInfo($templateFile, dirname($templateFile), basename($templateFile)); $expected = $instructions->getTemporaryDirectory().'/dump.json'; - $actual = $this->subject->write($instructions, $file, ['bar' => 'bar']); + $actual = $this->subject->write($instructions, $file, variables: ['bar' => 'bar']); + + self::assertSame($expected, $actual->getPathname()); + self::assertFileExists($expected); + + $expectedJson = [ + 'instructions' => [ + 'sourceDirectory' => dirname(__DIR__, 2).'/templates/src', + 'sharedSourceDirectory' => dirname(__DIR__, 2).'/templates/shared', + ], + 'foo' => 'foo', + 'bar' => 'bar', + ]; + + self::assertJson($actual->getContents()); + self::assertSame($expectedJson, json_decode($actual->getContents(), true, 512, JSON_THROW_ON_ERROR)); + + (new Filesystem\Filesystem())->remove(dirname($expected)); + } + + /** + * @test + */ + public function writeWritesRenderedTemplateFileToGivenTargetFile(): void + { + $instructions = new Src\Builder\BuildInstructions( + self::$container->get('app.config'), + 'foo', + ); + $instructions->addTemplateVariable('foo', 'foo'); + $instructions->addTemplateVariable('bar', 'foo'); + + $templateFile = dirname(__DIR__, 3).'/templates/dump.json.twig'; + $file = new Finder\SplFileInfo($templateFile, dirname($templateFile), basename($templateFile)); + + $expected = $instructions->getTemporaryDirectory().'/overrides/dump.json'; + $actual = $this->subject->write($instructions, $file, 'overrides/dump.json', ['bar' => 'bar']); self::assertSame($expected, $actual->getPathname()); self::assertFileExists($expected); diff --git a/tests/src/Fixtures/Templates/json-template/config.json b/tests/src/Fixtures/Templates/json-template/config.json index 2c249ea5..73066746 100644 --- a/tests/src/Fixtures/Templates/json-template/config.json +++ b/tests/src/Fixtures/Templates/json-template/config.json @@ -15,6 +15,11 @@ { "path": "*-3.json", "if": "false" + }, + { + "path": "dummy-4.json", + "if": "true", + "target": "overrides/dummy-4.json" } ] } @@ -30,6 +35,11 @@ { "path": "shared-*-3.json", "if": "false" + }, + { + "path": "shared-dummy-4.json", + "if": "true", + "target": "overrides/shared-dummy-4.json" } ] } diff --git a/tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy-2.json b/tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy-2.json new file mode 100644 index 00000000..df68a9c2 --- /dev/null +++ b/tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy-2.json @@ -0,0 +1,3 @@ +{ + "hello": "world" +} diff --git a/tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy-3.json b/tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy-3.json new file mode 100644 index 00000000..df68a9c2 --- /dev/null +++ b/tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy-3.json @@ -0,0 +1,3 @@ +{ + "hello": "world" +} diff --git a/tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy-4.json b/tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy-4.json new file mode 100644 index 00000000..df68a9c2 --- /dev/null +++ b/tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy-4.json @@ -0,0 +1,3 @@ +{ + "hello": "world" +} diff --git a/tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy.json.twig b/tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy.json.twig new file mode 100644 index 00000000..12fac785 --- /dev/null +++ b/tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy.json.twig @@ -0,0 +1,3 @@ +{ + "name": "{{ bar.name }}" +} diff --git a/tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy.yaml.twig b/tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy.yaml.twig deleted file mode 100644 index b74adc46..00000000 --- a/tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy.yaml.twig +++ /dev/null @@ -1 +0,0 @@ -name: "{{ bar.name }}" diff --git a/tests/src/Fixtures/Templates/json-template/templates/src/dummy-4.json b/tests/src/Fixtures/Templates/json-template/templates/src/dummy-4.json new file mode 100644 index 00000000..df68a9c2 --- /dev/null +++ b/tests/src/Fixtures/Templates/json-template/templates/src/dummy-4.json @@ -0,0 +1,3 @@ +{ + "hello": "world" +} diff --git a/tests/src/Fixtures/Templates/yaml-template/config.yaml b/tests/src/Fixtures/Templates/yaml-template/config.yaml index 7b2f7fba..ad40794c 100644 --- a/tests/src/Fixtures/Templates/yaml-template/config.yaml +++ b/tests/src/Fixtures/Templates/yaml-template/config.yaml @@ -9,6 +9,9 @@ steps: if: 'false' - path: '*-3.yaml' if: 'false' + - path: dummy-4.yaml + if: 'true' + target: 'overrides/dummy-4.yaml' - type: processSharedSourceFiles options: fileConditions: @@ -16,6 +19,9 @@ steps: if: 'false' - path: 'shared-*-3.yaml' if: 'false' + - path: shared-dummy-4.yaml + if: 'true' + target: 'overrides/shared-dummy-4.yaml' - type: mirrorProcessedFiles properties: diff --git a/tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy-2.yaml b/tests/src/Fixtures/Templates/yaml-template/templates/shared/shared-dummy/templates/src/shared-dummy-4.yaml similarity index 100% rename from tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy-2.yaml rename to tests/src/Fixtures/Templates/yaml-template/templates/shared/shared-dummy/templates/src/shared-dummy-4.yaml diff --git a/tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy-3.yaml b/tests/src/Fixtures/Templates/yaml-template/templates/src/dummy-4.yaml similarity index 100% rename from tests/src/Fixtures/Templates/json-template/templates/shared/shared-dummy/templates/src/shared-dummy-3.yaml rename to tests/src/Fixtures/Templates/yaml-template/templates/src/dummy-4.yaml