예제 #1
0
파일: Db.php 프로젝트: namnv609/Codeception
 protected function cleanup()
 {
     $dbh = $this->driver->getDbh();
     if (!$dbh) {
         throw new ModuleConfigException(__CLASS__, "No connection to database. Remove this module from config if you don't need database repopulation");
     }
     try {
         // don't clear database for empty dump
         if (!count($this->sql)) {
             return;
         }
         $this->driver->cleanup();
     } catch (\Exception $e) {
         throw new ModuleException(__CLASS__, $e->getMessage());
     }
 }