/**
* Watches a promise and unwraps it if it is rejected.
*
* This method should be used on promises that have assertions inside of them
* so that their assertions bubble up and are caught by PHPUnit.
*
* @param ExtendedPromiseInterface $promise The promise to watch.
*/
public final function watchPromise(ExtendedPromiseInterface $promise)
{
$promise->done(null, function (\Exception $exception) {
$this->exceptionQueue->enqueue($exception);
});
}