|
12 | 12 | use Magento\FunctionalTestingFramework\Test\Handlers\TestObjectHandler;
|
13 | 13 | use Magento\FunctionalTestingFramework\Util\Path\FilePathFormatter;
|
14 | 14 | use Symfony\Component\Console\Command\Command;
|
| 15 | +use Symfony\Component\Console\Input\InputInterface; |
15 | 16 | use Symfony\Component\Console\Input\InputOption;
|
16 | 17 | use Symfony\Component\Console\Output\OutputInterface;
|
17 | 18 | use Magento\FunctionalTestingFramework\Util\Filesystem\DirSetupUtil;
|
18 | 19 | use Magento\FunctionalTestingFramework\Util\TestGenerator;
|
19 | 20 | use Magento\FunctionalTestingFramework\Config\MftfApplicationConfig;
|
20 | 21 | use Magento\FunctionalTestingFramework\Suite\Handlers\SuiteObjectHandler;
|
| 22 | +use Symfony\Component\Console\Style\SymfonyStyle; |
21 | 23 |
|
22 | 24 | class BaseGenerateCommand extends Command
|
23 | 25 | {
|
| 26 | + const MFTF_3_O_0_DEPRECATION_MESSAGE = "MFTF NOTICES:\n" |
| 27 | + . "DEPRECATED ACTIONS: \"executeInSelenium\" and \"performOn\" actions will be removed in MFTF 3.0.0\n" |
| 28 | + . "DEPRECATED TEST PATH: support for \"dev/tests/acceptance/tests/functional/Magento/FunctionalTest will be " |
| 29 | + . "removed in MFTF 3.0.0\n" |
| 30 | + . "XSD schema change to only allow single entity per xml file for all entities except data and metadata in " |
| 31 | + . "MFTF 3.0.0\n"; |
| 32 | + |
| 33 | + /** |
| 34 | + * Console output style |
| 35 | + * |
| 36 | + * @var SymfonyStyle |
| 37 | + */ |
| 38 | + private $ioStyle = null; |
| 39 | + |
24 | 40 | /**
|
25 | 41 | * Configures the base command.
|
26 | 42 | *
|
@@ -178,4 +194,33 @@ protected function getGroupAndSuiteConfiguration(array $groupOrSuiteNames)
|
178 | 194 | $json = json_encode($result);
|
179 | 195 | return $json;
|
180 | 196 | }
|
| 197 | + |
| 198 | + /** |
| 199 | + * Set Symfony Style for output |
| 200 | + * |
| 201 | + * @param InputInterface $input |
| 202 | + * @param OutputInterface $output |
| 203 | + */ |
| 204 | + protected function setOutputStyle(InputInterface $input, OutputInterface $output) |
| 205 | + { |
| 206 | + // For output style |
| 207 | + if (null === $this->ioStyle) { |
| 208 | + $this->ioStyle = new SymfonyStyle($input, $output); |
| 209 | + } |
| 210 | + } |
| 211 | + |
| 212 | + /** |
| 213 | + * Show predefined global notice messages |
| 214 | + * |
| 215 | + * @param OutputInterface $output |
| 216 | + * @return void |
| 217 | + */ |
| 218 | + protected function showMftfNotices(OutputInterface $output) |
| 219 | + { |
| 220 | + if (null !== $this->ioStyle) { |
| 221 | + $this->ioStyle->note(self::MFTF_3_O_0_DEPRECATION_MESSAGE); |
| 222 | + } else { |
| 223 | + $output->writeln(self::MFTF_3_O_0_DEPRECATION_MESSAGE); |
| 224 | + } |
| 225 | + } |
181 | 226 | }
|
0 commit comments