/**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $this->client = static::createClient();
     $this->twig = $this->client->getContainer()->get('twig');
     $this->loginHelper = new LoginTestHelper($this->client);
 }
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $this->loginHelper = new LoginTestHelper(static::createClient());
     $this->client = $this->loginHelper->loginAction();
     $this->container = $this->client->getContainer();
 }
 /**
  * Sets up required info before each test.
  *
  * @throws \Exception
  */
 protected function setUp()
 {
     parent::setUp();
     AnnotationRegistry::registerFile($this->getVendorDirectory() . '/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
     /** @var EntityManager $entityManager */
     $entityManager = $this->getEntityManager();
     $connection = $entityManager->getConnection();
     $params = $connection->getParams();
     $name = $connection->getParams()['dbname'];
     unset($params['dbname']);
     $tmpConnection = DriverManager::getConnection($params);
     $name = $tmpConnection->getDatabasePlatform()->quoteSingleIdentifier($name);
     try {
         $tmpConnection->getSchemaManager()->dropDatabase($name);
     } catch (\Exception $ex) {
         if (strpos($ex->getMessage(), 'Error: 1009') === null) {
             throw $ex;
         }
         // Catching exception in case database not dropped.
     }
     $tmpConnection->getSchemaManager()->createDatabase($name);
     $tmpConnection->close();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->client = new LoginTestHelper(static::createClient());
 }