application = new Application($kernel); $container = self::$kernel->getContainer(); $this->application->add(new InstallCommand( $container->getParameter('kernel.project_dir'), $container->get('doctrine')->getConnection() )); return $this->application->find('kimai:install'); } public function testFullRunWithEverythingPreInstalled() { $command = $this->getCommand(); $commandTester = new CommandTester($command); $commandTester->setInputs(['no']); $commandTester->execute([ 'command' => $command->getName(), ]); $result = $commandTester->getDisplay(); self::assertStringContainsString('Kimai installation running', $result); // create database is skipped self::assertStringContainsString('[NOTE] Database is existing and connection could be established', $result); // make sure migrations run always self::assertStringContainsString('Application Migrations', $result); self::assertStringContainsString('No migrations to execute.', $result); self::assertStringContainsString( sprintf('[OK] Congratulations! Successfully installed Kimai 2 version %s (%s)', Constants::VERSION, Constants::STATUS), $result ); self::assertEquals(0, $commandTester->getStatusCode()); } }