public function shouldReturnPromiseFromFactory()
{
$factory = $this->createCallableMock();
$factory->expects($this->once())->method('__invoke')->will($this->returnValue(new FulfilledPromise(1)));
$onFulfilled = $this->createCallableMock();
$onFulfilled->expects($this->once())->method('__invoke')->with($this->identicalTo(1));
$p = new LazyPromise($factory);
$p->then($onFulfilled);
}