protected function setUp()
 {
     parent::setUp();
     $options = ['host' => getenv('LHM_DATABASE_HOST') ?: 'localhost', 'name' => getenv('LHM_DATABASE_NAME') ?: 'lhm_php_test', 'user' => getenv('LHM_DATABASE_USER') ?: 'root', 'pass' => getenv('LHM_DATABASE_PASSWORD') ?: null, 'port' => getenv('LHM_DATABASE_PORT') ?: 3306];
     $this->adapter = new MysqlAdapter($options, new NullOutput());
     $this->adapter->setOptions($options);
     // ensure the database is empty for each test
     $this->adapter->dropDatabase($options['name']);
     $this->adapter->createDatabase($options['name']);
     // leave the adapter in a disconnected state for each test
     $this->adapter->disconnect();
 }
Exemplo n.º 2
0
 /**
  * Drops the specified database.
  *
  * @param string $name Database Name
  * @return void
  */
 public function dropDatabase($name)
 {
     $this->adapter->dropDatabase($name);
 }