public function testApiDone_ThrowsException_WhenRejectionHandlerRejects()
{
$deferred = $this->createDeferred();
$test = $this->getTest();
$test->setExpectedException(RejectionException::class);
$test->assertNull($deferred->getPromise()->done(null, function () {
return Promise::doReject();
}));
$deferred->reject(1);
}