public function testExceptionsCauseRollback()
{
$connection = \Mockery::mock('\\Pheasant\\Database\\Mysqli\\Connection');
$connection->shouldReceive('execute')->with('BEGIN')->once();
$connection->shouldReceive('execute')->with('ROLLBACK')->once();
$transaction = new Transaction($connection);
$transaction->callback(function () {
throw new \Exception('Eeeek!');
});
$this->setExpectedException('\\Exception');
$transaction->execute();
}