| Total Complexity | 5 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | class ConsoleHelper extends Module |
||
| 16 | { |
||
| 17 | use ModuleHelperConfigTrait; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | public const RUNNER = 'console_runner.php'; |
||
| 23 | /** |
||
| 24 | * @var string |
||
| 25 | */ |
||
| 26 | public const SANDBOX_DIR = 'cli_sandbox/'; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @param \Codeception\TestInterface $test |
||
| 30 | * |
||
| 31 | * @return void |
||
| 32 | */ |
||
| 33 | public function _after(TestInterface $test) |
||
| 34 | { |
||
| 35 | foreach ($this->config['cleanup_dirs'] as $dir) { |
||
| 36 | $dir = codecept_data_dir() . self::SANDBOX_DIR . $dir; |
||
|
|
|||
| 37 | $this->debugSection('Cleanup', $dir); |
||
| 38 | FileSystem::deleteDir($dir); |
||
| 39 | } |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @param string $command |
||
| 44 | * |
||
| 45 | * @return void |
||
| 46 | */ |
||
| 47 | public function runSprykerCommand($command) |
||
| 48 | { |
||
| 49 | $command = 'php ' . codecept_data_dir() . self::RUNNER . " $command"; |
||
| 50 | $this->getCli()->runShellCommand($command); |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @return void |
||
| 55 | */ |
||
| 56 | protected function setDefaultConfig(): void |
||
| 60 | ]; |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @return \Codeception\Module\Cli|\Codeception\Module |
||
| 65 | */ |
||
| 66 | protected function getCli() |
||
| 69 | } |
||
| 70 | } |
||
| 71 |