private function mockConnection()
{
$schemaManager = $this->getMock('Doctrine\\DBAL\\Schema\\MySqlSchemaManager', ['tablesExist'], [], '', false);
$schemaManager->expects($this->any())->method('tablesExist')->willReturn(true);
$connection = $this->getMock('Doctrine\\DBAL\\Connection', ['getSchemaManager'], [], '', false);
$connection->expects($this->any())->method('getSchemaManager')->willReturn($schemaManager);
return $connection;
}