示例#1
0
 /**
  * Test proper behavior if Process is not successful
  */
 public function testProcessFailure()
 {
     $command = rand();
     $this->process->method('isSuccessful')->willReturn(false);
     $this->process->method('getCommandLine')->willReturn($command);
     $this->process->expects($this->never())->method('getOutput');
     $logger = $this->getMock('\\Psr\\Log\\LoggerInterface');
     $this->fixture->setLogger($logger);
     $logger->expects($this->at(0))->method('warning')->with('Problem executing command');
     $logger->expects($this->at(1))->method('warning')->with('Details: `' . $command . '`');
     $actual = $this->fixture->find();
     $this->assertEquals('', $actual);
 }
 public function test_it_will_not_try_to_initialize_behat_if_installation_fails()
 {
     $this->packageMock->expects(static::any())->method('hasPackage')->with('behat/behat', null, $this->inputMock, $this->outputMock)->willReturn(false);
     $this->requireMock->expects(static::any())->method('requirePackage')->willReturn($status = 7);
     $this->processMock->expects(static::never())->method('mustRun');
     static::assertEquals($status, $this->sut->run($this->inputMock, $this->outputMock));
 }
 public function testStop()
 {
     $this->process->expects($this->once())->method('getOutput')->will($this->returnValue($this->getPsOutput()));
     $this->process->expects($this->once())->method('isSuccessful')->will($this->returnValue(true));
     $this->assertTrue($this->object->stop());
 }
示例#4
0
 /**
  * Test Process run method
  */
 public function testProcessRun()
 {
     $this->process->expects($this->once())->method('run');
     $this->fixture->decode(null, null);
 }