Graze\Supervisor\ProcessSupervisorTest::testUnsuccessfullyTerminatedPing PHP Méthode

testUnsuccessfullyTerminatedPing() public méthode

    public function testUnsuccessfullyTerminatedPing()
    {
        $err = 'foo';
        $out = 'bar';
        $this->process->shouldReceive('isTerminated')->once()->withNoArgs()->andReturn(true);
        $this->process->shouldReceive('isSuccessful')->once()->withNoArgs()->andReturn(false);
        $this->process->shouldReceive('getErrorOutput')->times(2)->withNoArgs()->andReturn($err);
        $this->process->shouldReceive('getOutput')->times(2)->withNoArgs()->andReturn($out);
        $this->process->shouldReceive('getCommandLine')->once()->withNoArgs()->andReturn('cli');
        $this->process->shouldReceive('getExitCode')->once()->withNoArgs()->andReturn(123);
        $this->process->shouldReceive('getExitCodeText')->once()->withNoArgs()->andReturn('baz');
        $this->handler->shouldReceive('handleFail')->once()->with(0, $this->sup, m::type('Graze\\Supervisor\\Exception\\TerminatedProcessException'));
        $this->assertFalse($this->sup->ping());
        $this->assertEquals($err, $this->sup->stderr);
        $this->assertEquals($out, $this->sup->stdout);
    }