Kraken\_Unit\Promise\_Partial\PromiseCancelledPartial::testApiAlways_DoesNotSuppressCancellation_WhenHandlerThrows_ForCancelledPromise PHP Метод

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

    public function testApiAlways_DoesNotSuppressCancellation_WhenHandlerThrows_ForCancelledPromise()
    {
        $deferred = $this->createDeferred();
        $test = $this->getTest();
        $ex1 = new Exception();
        $ex2 = new Exception();
        $mock = $test->createCallableMock();
        $mock->expects($test->once())->method('__invoke')->with($test->identicalTo($ex1));
        $deferred->cancel($ex1);
        $deferred->getPromise()->always(function () use($ex2) {
            throw $ex2;
        })->then(null, null, $mock);
    }
PromiseCancelledPartial