Fix Mockery

This is a more elegant way to configure Mockery.
It also avoid using ``::close()`` in ``tearDown()`` each time we need Mockery.