Kraken\_Unit\Runtime\RuntimeModelTest::testApiIsFailed_ReturnsTrue_WhenStateDoesMatch PHP Method

testApiIsFailed_ReturnsTrue_WhenStateDoesMatch() public method

    public function testApiIsFailed_ReturnsTrue_WhenStateDoesMatch()
    {
        $ex = new Exception();
        $params = [];
        $super = $this->getMock(Supervisor::class, [], [], '', false);
        $loop = $this->getMock(Loop::class, [], [], '', false);
        $loop->expects($this->once())->method('onTick');
        $runtime = $this->createModel([], ['getSupervisor', 'getLoop', 'setLoopState']);
        $runtime->expects($this->once())->method('getSupervisor')->will($this->returnValue($super));
        $runtime->expects($this->once())->method('getLoop')->will($this->returnValue($loop));
        $runtime->expects($this->once())->method('setLoopState');
        $runtime->fail($ex, $params);
        $this->assertTrue($runtime->isFailed());
    }
RuntimeModelTest