Kraken\_Unit\Promise\_Partial\PromiseFulfilledPartial::testApiAlways_RejectsPromise_WhenHandlerThrows_ForFulfilledPromise PHP Метод

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

    public function testApiAlways_RejectsPromise_WhenHandlerThrows_ForFulfilledPromise()
    {
        $deferred = $this->createDeferred();
        $test = $this->getTest();
        $exception = new Exception();
        $mock = $test->createCallableMock();
        $mock->expects($test->once())->method('__invoke')->with($test->identicalTo($exception));
        $deferred->resolve(1);
        $deferred->getPromise()->always(function () use($exception) {
            throw $exception;
        })->then(null, $mock);
    }
PromiseFulfilledPartial