6 declare(strict_types = 1);
10 use Symfony\Component\Console\Command\Command;
11 use Symfony\Component\Console\Input\InputInterface;
12 use Symfony\Component\Console\Input\InputOption;
13 use Symfony\Component\Console\Output\OutputInterface;
14 use Symfony\Component\Filesystem\Filesystem;
15 use Symfony\Component\Finder\Finder;
21 TESTS_BP . DIRECTORY_SEPARATOR .
'codeception.yml',
23 TESTS_BP . DIRECTORY_SEPARATOR .
'tests' . DIRECTORY_SEPARATOR .
'functional.suite.yml',
25 FW_BP .
'/src/Magento/FunctionalTestingFramework/_generated',
27 FW_BP .
'/src/Magento/FunctionalTestingFramework/AcceptanceTester.php' 31 TESTS_MODULE_PATH .
'/_generated' 41 $this->setName(
'reset')
43 'This command will clean any configuration files from the environment (not including .env), as well as generated artifacts.' 45 ->addOption(
'hard',
null, InputOption::VALUE_NONE,
"parameter to force reset of configuration files.");
58 $isHardReset = $input->getOption(
'hard');
59 $fileSystem =
new Filesystem();
60 $finder =
new Finder();
61 $finder->files()->name(
'*.php')->in(realpath(FW_BP .
'/src/Magento/FunctionalTestingFramework/Group/'));
62 $filesForRemoval = [];
66 $filesForRemoval = array_merge($filesForRemoval, self::CONFIGURATION_FILES);
70 $filesForRemoval = array_merge($filesForRemoval, self::GENERATED_FILES);
73 $output->writeln(
'Deleting Files:');
77 foreach ($finder->files() as $file) {
79 $output->writeln($file->getRealPath());
82 $fileSystem->remove($file);
86 foreach ($filesForRemoval as $fileForRemoval) {
87 if ($fileSystem->exists($fileForRemoval) &&
$output->isVerbose()) {
88 $output->writeln($fileForRemoval);
91 $fileSystem->remove($fileForRemoval);
94 $output->writeln(
'mftf files removed from filesystem.');
execute(InputInterface $input, OutputInterface $output)
const CONFIGURATION_FILES