DataSift\Storyplayer\CommandLib\CommandResultTest::testCanDetectFailedCommand PHP Метод

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

    public function testCanDetectFailedCommand()
    {
        for ($i = -255; $i < 256; $i++) {
            // avoid 0 - it is the return code when a command has succeeded
            if ($i == 0) {
                continue;
            }
            // ------------------------------------------------------------
            // setup your test
            $obj = new CommandResult($i, '');
            // ------------------------------------------------------------
            // perform the change
            $didFail = $obj->didCommandFail();
            $didSucceed = $obj->didCommandSucceed();
            // ------------------------------------------------------------
            // test the results
            $this->assertTrue($didFail);
            $this->assertFalse($didSucceed);
        }
    }