public function testExecute()
 {
     $conf = $this->getTestConfiguration();
     $this->getSessionServer($conf);
     $application = new CLI('Gloubster');
     $application->command(new ServerEnsureConfiguration($conf));
     $logger = $this->getLogger();
     $logger->expects($this->never())->method('addError');
     $logger->expects($this->never())->method('addInfo');
     $application['monolog'] = $logger;
     $command = $application['console']->find('server:ensure-configuration');
     $commandTester = new CommandTester($command);
     $commandTester->execute(array('command' => $command->getName(), '--dry-run' => true));
     $this->assertGreaterThanOrEqual(0, strpos($commandTester->getDisplay(), 'Running command as dry-run'));
 }
Exemple #2
0
 public function testExecute()
 {
     $conf = $this->getTestConfiguration();
     $this->getSessionServer($conf);
     $application = new CLI('Gloubster');
     $application->command(new RunServer($conf));
     $logger = $this->getLogger();
     $logger->expects($this->never())->method('addError');
     $logger->expects($this->atLeastOnce())->method('addInfo');
     $application['monolog'] = $logger;
     $command = $application['console']->find('server:run');
     $commandTester = new CommandTester($command);
     $commandTester->execute(array('command' => $command->getName(), '--test' => true));
     $this->assertEquals('', $commandTester->getDisplay());
 }