Exemplo n.º 1
0
 public function testExecuteCommand()
 {
     ob_start();
     $this->container->executeCommand('--version --no-ansi');
     exec('php ' . __DIR__ . '/../../../../app/console --version --no-ansi', $output);
     $this->assertEquals($output[0] . PHP_EOL, ob_get_clean());
 }
Exemplo n.º 2
0
 /**
  * Test execute failed. Undefined bundle.
  */
 public function testExecuteNoBundle()
 {
     $this->touchConfig('/src/Resources/config/routing.yml');
     $this->container->expects($this->never())->method('getManipulator');
     // test
     $this->execute('', '');
 }
Exemplo n.º 3
0
 /**
  * @param string $command
  * @param bool $decorated
  * @param \PHPUnit_Framework_MockObject_Matcher_Invocation|null $matcher
  */
 protected function executeCommand($command, $decorated, \PHPUnit_Framework_MockObject_Matcher_Invocation $matcher = null)
 {
     if ($decorated) {
         $command .= ' --ansi';
     }
     $this->io->expects($this->atLeastOnce())->method('isDecorated')->will($this->returnValue($decorated));
     $this->event_command->expects($this->atLeastOnce())->method('getIO')->will($this->returnValue($this->io));
     $this->container->expects($matcher ?: $this->once())->method('executeCommand')->with($command, 0);
 }
Exemplo n.º 4
0
 /**
  * Test no add in execute.
  *
  * @dataProvider getNoAddJobs
  *
  * @param \Closure $get_job
  */
 public function testNoAdd(\Closure $get_job)
 {
     $this->container->expects($this->never())->method('getManipulator');
     $this->execute($get_job, $this->once(), '');
     // test
 }