Skip to content

Commit 3b651e4

Browse files
committed
[TASK] Use newly introduced extension selection and cleanup old code
1 parent 48a344b commit 3b651e4

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

Classes/Command/AcceptanceTestsCommand.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
use Symfony\Component\Console\Input\InputInterface;
1616
use Symfony\Component\Console\Output\OutputInterface;
17-
use Symfony\Component\Console\Style\SymfonyStyle;
1817
use Symfony\Component\Filesystem\Exception\IOException;
1918
use Symfony\Component\Filesystem\Filesystem;
2019
use Symfony\Component\Finder\Finder;
@@ -32,11 +31,6 @@ class AcceptanceTestsCommand extends AbstractCommand
3231
*/
3332
protected $filesystem;
3433

35-
/**
36-
* @var SymfonyStyle $io
37-
*/
38-
protected $io;
39-
4034
/**
4135
* @var PackageInterface $package
4236
*/
@@ -54,8 +48,7 @@ protected function configure(): void
5448
*/
5549
protected function execute(InputInterface $input, OutputInterface $output): int
5650
{
57-
$this->io = new SymfonyStyle($input, $output);
58-
$this->package = $this->askForPackage($this->io);
51+
$this->package = $this->packageResolver->resolvePackage($this->askForExtensionKey());
5952

6053
$packageKey = $this->package->getPackageKey();
6154
$targetPackagePath = $this->package->getPackagePath();
@@ -70,7 +63,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7063
$finder = GeneralUtility::makeInstance(Finder::class);
7164

7265
$codeTemplatePath = '/Resources/Private/CodeTemplates/AcceptanceTests';
73-
$templatePath = $this->getPackageResolver()->resolvePackage('b13/make')->getPackagePath() . $codeTemplatePath;
66+
$templatePath = $this->packageResolver->resolvePackage('b13/make')->getPackagePath() . $codeTemplatePath;
7467

7568
$this->filesystem->mkdir([
7669
$targetPackagePath . '/Tests/Acceptance/Fixtures',

Classes/Command/RunTestsCommand.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7373
);
7474
}
7575

76+
$this->io->writeln('<info>Created docker environment for testing:</info>');
77+
$filePaths = array_map(function ($ar) {return $ar['target'];}, $templatesToCreate);
78+
$this->io->listing($filePaths);
79+
$this->io->writeln('For details run "cd ' . $this->package->getPackagePath() . ' && ' . 'Build/Scripts/runTests.sh -h"');
80+
7681
return 0;
7782
}
7883

@@ -94,6 +99,9 @@ protected function prepareTemplate(string $source, string $target): void
9499

95100
try {
96101
$this->filesystem->dumpFile($target, $templateContent);
102+
if ((pathinfo($target)['extension'] ?? '') === 'sh') {
103+
$this->filesystem->chmod([$target], 0770);
104+
}
97105
} catch (IOException $exception) {
98106
$this->io->writeln('<error>Failed to save file in ' . $target . PHP_EOL . $exception->getMessage() . '</error>');
99107
}

0 commit comments

Comments
 (0)