Exemplo n.º 1
0
 /**
  * Construct the database driver.
  *
  * @return \pdyn\database\pdo\sqlite\tests\MockDriver The mock database driver.
  */
 public function construct_driver()
 {
     $DB = new MockDriver(['\\pdyn\\database\\tests\\lib\\DbTestSchema']);
     $dsn = 'sqlite::memory:';
     $DB->connect($dsn);
     $DB->set_prefix(static::DBPREFIX);
     return $DB;
 }
Exemplo n.º 2
0
 /**
  * Construct the database driver.
  *
  * @return \pdyn\database\pdo\mysql\DbDriver The mock database driver.
  */
 public function construct_driver()
 {
     $mysqlenabled = defined('PDYN_DATABASE_TESTMYSQL') && PDYN_DATABASE_TESTMYSQL === true ? true : false;
     if ($mysqlenabled !== true) {
         $this->markTestSkipped('Not using MySQL driver');
         return false;
     }
     $DB = new MockDriver(['\\pdyn\\database\\tests\\lib\\DbTestSchema']);
     $dsn = 'mysql:host=' . PDYN_DATABASE_HOST . ';dbname=' . PDYN_DATABASE_DATABASE;
     $DB->connect($dsn, PDYN_DATABASE_USER, PDYN_DATABASE_PASSWORD);
     $DB->set_prefix(static::DBPREFIX);
     return $DB;
 }