示例#1
0
 /**
  * Tears down the fixture, for example, closes a network connection.
  * This method is called after a test is executed.
  */
 protected function tearDown()
 {
     if (!$this->object->hasExport()) {
         if ($this->object->hasTable(PHIGRATE_TS_SCHEMA_TBL_NAME)) {
             $this->object->dropTable(PHIGRATE_TS_SCHEMA_TBL_NAME);
         }
         $this->object->query('SET FOREIGN_KEY_CHECKS=0;');
         if ($this->object->hasTable('users')) {
             $this->object->dropTable('users');
         }
         if ($this->object->hasTable('new_users')) {
             $this->object->dropTable('new_users');
         }
         if ($this->object->hasTable('contacts')) {
             $this->object->dropTable('contacts');
         }
         if ($this->object->hasTable('v_users')) {
             $this->object->executeDdl("DROP VIEW `v_users`;");
         }
         if ($this->object->hasTable('addresses')) {
             $this->object->dropTable('addresses');
         }
         if ($this->object->hasTable('users_addresses')) {
             $this->object->dropTable('users_addresses');
         }
         $this->object->query('SET FOREIGN_KEY_CHECKS=1;');
     }
     $this->object = null;
     parent::tearDown();
 }