From c00bcd645b1c060658b7563b640b313086cd0cea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Unger?= Date: Mon, 19 Dec 2016 22:08:52 +0100 Subject: [PATCH] fix tests --- tests/Console/GenerateProxiesCommandTest.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/Console/GenerateProxiesCommandTest.php b/tests/Console/GenerateProxiesCommandTest.php index 80982bf..affb81c 100644 --- a/tests/Console/GenerateProxiesCommandTest.php +++ b/tests/Console/GenerateProxiesCommandTest.php @@ -14,6 +14,7 @@ public function testCommand() { $tempDir = __DIR__ . '/../temp/Console'; Helpers::initTempDir($tempDir); + Helpers::initTempDir($tempDir . '/../proxies'); $container = (new Configurator()) ->setTempDirectory($tempDir) @@ -24,10 +25,14 @@ public function testCommand() /** @var Application $application */ $application = $container->getByType(Application::class); - $tester = new CommandTester($application->find('lookyman:nette-proxy:generate')); - $tester->execute(['command' => 'lookyman:nette-proxy:generate']); + $command = $application->find('lookyman:nette-proxy:generate'); + $tester = new CommandTester($command); + $tester->execute([ + 'command' => $command->getName(), + '--debug' => null, + ]); - self::assertFileExists(__DIR__ . '/../temp/proxies/ProxyManagerGeneratedProxy__PM__LookymanNetteProxyTestsMockIService2FactoryGeneratedee1449ea0da0fdbf038d28254e9c7b3f.php'); - self::assertFileExists(__DIR__ . '/../temp/proxies/ProxyManagerGeneratedProxy__PM__LookymanNetteProxyTestsMockService1Generateda427b08305d9796d18525e91e7b08e56.php'); + self::assertNotEquals('', $tester->getDisplay()); + self::assertCount(2, new \FilesystemIterator($tempDir . '/../proxies', \FilesystemIterator::SKIP_DOTS)); } }