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
 /**
  * Creates a new database.
  *
  * @param string $name Database Name
  * @param array $options Options
  * @return void
  */
 public function createDatabase($name, $options = [])
 {
     $this->adapter->createDatabase($name, $options);
 }
 /**
  * Creates a new database.
  *
  * @param string $name    Database Name
  * @param array  $options Options
  *
  * @return TableMigrationInterface
  */
 public function createDatabase($name, array $options = [])
 {
     $this->adapter->createDatabase($name, $options);
     return $this;
 }
Exemplo n.º 4
0
 /**
  * Creates a new database.
  *
  * @param string $name Database Name
  * @param array $options Options
  * @return void
  */
 public function createDatabase($name, $options = array())
 {
     return $this->adapter->createDatabase($name, $options);
 }