DataSift\Storyplayer\CommandLib\CommandRunnerTest::testReturns127IfTheCommandDoesNotExist PHP Метод

testReturns127IfTheCommandDoesNotExist() публичный Метод

    public function testReturns127IfTheCommandDoesNotExist()
    {
        // ----------------------------------------------------------------
        // setup your test
        // our test subject
        $obj = new CommandRunner();
        // a fake logging object
        $log = Mockery::mock("DataSift\\Storyplayer\\PlayerLib\\Action_LogItem");
        $log->shouldReceive('endAction')->once();
        $log->shouldReceive('captureOutput')->once();
        // our mocked $st
        $st = Mockery::mock("DataSift\\Storyplayer\\PlayerLib\\StoryTeller");
        $st->shouldReceive('startAction')->andReturn($log);
        // our example command
        $helperCmd = "/fred/alice/this_command_does_not_exist";
        // ----------------------------------------------------------------
        // perform the change
        $result = $obj->runSilently($st, $helperCmd);
        // ----------------------------------------------------------------
        // test the results
        $this->assertTrue($result instanceof CommandResult);
        $this->assertEquals(127, $result->returnCode);
    }