Example #1
0
 public function create_database_test()
 {
     $admin = new YawfAdmin();
     $test_db_exists = file_exists($this->database_filename);
     $this->should_not('have a test database already', $test_db_exists, $admin->get_database());
     parent::create_database();
     $test_db_exists = file_exists($this->database_filename);
     $this->should('have a test database now', $test_db_exists, $admin->get_database());
 }
Example #2
0
 protected function create_database()
 {
     // Create a YAWF database, but only do it once
     $admin = new YawfAdmin();
     if (file_exists($admin->get_database())) {
         return;
     }
     $sql = file_get_contents('app/data/YAWF_' . DB_CONNECTOR . '.sql');
     $admin->query($sql);
 }