Kraken\_Unit\Promise\_Partial\ApiRejectPartial::testApiAlways_RejectsPromise_WhenHandlerThrows_AfterReject PHP Метод

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

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