application = new Application($kernel); $container = self::$kernel->getContainer(); $this->application->add(new UpdateCommand( $container->get('doctrine')->getConnection(), $this->application->getKernel()->getEnvironment() )); return $this->application->find('kimai:update'); } public function testFullRun() { $command = $this->getCommand(); $commandTester = new CommandTester($command); $commandTester->setInputs(['no']); $commandTester->execute([ 'command' => $command->getName(), ]); $result = $commandTester->getDisplay(); self::assertStringContainsString('Kimai updates running', $result); // make sure migrations run always self::assertStringContainsString('[OK] Already at the latest version ("DoctrineMigrations\\', $result); self::assertStringContainsString( sprintf('[OK] Congratulations! Successfully updated Kimai to version %s', Constants::VERSION), $result ); self::assertEquals(0, $commandTester->getStatusCode()); } }