React\Promise\PromiseTest\CancelTestTrait::cancelShouldCallCancellerFromDeepNestedPromiseChain PHP Метод

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

    public function cancelShouldCallCancellerFromDeepNestedPromiseChain()
    {
        $mock = $this->createCallableMock();
        $mock->expects($this->once())->method('__invoke');
        $adapter = $this->getPromiseTestAdapter($mock);
        $promise = $adapter->promise()->then(function () {
            return new Promise\Promise(function () {
            });
        })->then(function () {
            $d = new Promise\Deferred();
            return $d->promise();
        })->then(function () {
            return new Promise\Promise(function () {
            });
        });
        $promise->cancel();
    }