React\Promise\FunctionResolveTest::shouldSupportDeepNestingInPromiseChains PHP Method

shouldSupportDeepNestingInPromiseChains() public method

    public function shouldSupportDeepNestingInPromiseChains()
    {
        $d = new Deferred();
        $d->resolve(false);
        $result = resolve(resolve($d->promise()->then(function ($val) {
            $d = new Deferred();
            $d->resolve($val);
            $identity = function ($val) {
                return $val;
            };
            return resolve($d->promise()->then($identity))->then(function ($val) {
                return !$val;
            });
        })));
        $mock = $this->createCallableMock();
        $mock->expects($this->once())->method('__invoke')->with($this->identicalTo(true));
        $result->then($mock);
    }