| Conditions | 1 |
| Paths | 1 |
| Total Lines | 25 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 13 | public function testCommand() |
||
| 14 | { |
||
| 15 | $tempDir = __DIR__ . '/../temp/Console'; |
||
| 16 | Helpers::initTempDir($tempDir); |
||
| 17 | Helpers::initTempDir($tempDir . '/../proxies'); |
||
| 18 | |||
| 19 | $container = (new Configurator()) |
||
| 20 | ->setTempDirectory($tempDir) |
||
| 21 | ->setDebugMode(true) |
||
| 22 | ->addConfig(__DIR__ . '/../config/config.neon') |
||
| 23 | ->createContainer(); |
||
| 24 | $container->initialize(); |
||
| 25 | |||
| 26 | /** @var Application $application */ |
||
| 27 | $application = $container->getByType(Application::class); |
||
| 28 | $command = $application->find('lookyman:nette-proxy:generate'); |
||
| 29 | $tester = new CommandTester($command); |
||
| 30 | $tester->execute([ |
||
| 31 | 'command' => $command->getName(), |
||
| 32 | '--debug' => null, |
||
| 33 | ]); |
||
| 34 | |||
| 35 | self::assertNotEquals('', $tester->getDisplay()); |
||
| 36 | self::assertCount(2, new \FilesystemIterator($tempDir . '/../proxies', \FilesystemIterator::SKIP_DOTS)); |
||
| 37 | } |
||
| 38 | } |
||
| 39 |