public function testApiDone_ThrowsException_WhenHandlerCancelsWithException_ForCancelledPromise()
{
$deferred = $this->createDeferred();
$test = $this->getTest();
$test->setExpectedException(Exception::class, 'CancellationException');
$deferred->cancel(new Exception('CancellationException'));
$test->assertNull($deferred->getPromise()->done());
}