Kraken\_Unit\Promise\_Partial\PromiseRejectedPartial::testApiDone_ThrowsException_WithDeepNestingPromiseChains_ForRejectedPromise PHP Метод

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

    public function testApiDone_ThrowsException_WithDeepNestingPromiseChains_ForRejectedPromise()
    {
        $test = $this->getTest();
        $test->setExpectedException(Exception::class, 'UnhandledRejectionException');
        $exception = new Exception('UnhandledRejectionException');
        $d = new Deferred();
        $d->resolve();
        $result = Promise::doResolve(Promise::doResolve($d->getPromise()->then(function () use($exception) {
            $d = new Deferred();
            $d->resolve();
            return Promise::doResolve($d->getPromise()->then(function () {
            }))->then(function () use($exception) {
                throw $exception;
            });
        })));
        $result->done();
    }
PromiseRejectedPartial