public function testApiAlways_DoesNotSuppressCancellation_WhenHandlerReturnsPromise_ForCancelledPromise()
{
$deferred = $this->createDeferred();
$test = $this->getTest();
$exception = new Exception();
$mock = $test->createCallableMock();
$mock->expects($test->once())->method('__invoke')->with($test->identicalTo($exception));
$deferred->cancel($exception);
$deferred->getPromise()->always(function () {
return Promise::doResolve(1);
})->then(null, null, $mock);
}