public function testPromiseThen__ThenFromFulfilledByPromise() { $result = new Client($this->store); $promise1 = new Client($this->store); $promise1->resolve($result); $this->object = $promise1->then([get_class($this), 'callback']); $this->assertEquals($this->object->getId(), $this->object->wait(false)->getId()); $this->assertEquals(PromiseInterface::PENDING, $this->object->getState()); $result->resolve('result'); $this->assertEquals('result after callbak', $this->object->wait(false)); $this->assertEquals(PromiseInterface::FULFILLED, $this->object->getState()); }