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();
 }
Esempio n. 2
0
 /**
  * Set adapter configuration options.
  *
  * @param  array $options
  * @return AdapterInterface
  */
 public function setOptions(array $options)
 {
     return $this->adapter->setOptions($options);
 }