/** * @inheritDoc */ function setUp() { parent::setUp(); /* Remove temporary tables which causes problems with GF */ remove_all_filters('query', 10); /* Ensure the database is correctly set up */ @GFForms::setup_database(); $this->factory = new GF_UnitTest_Factory($this); }
public static function ensure_tables_exist() { global $wpdb; $form_table_name = self::get_form_table_name(); $form_count = $wpdb->get_var("SELECT count(0) FROM {$form_table_name}"); if ($wpdb->last_error) { GFCommon::log_debug('GFFormsModel::ensure_tables_exist(): Blog ' . get_current_blog_id() . ' - Form database table does not exist. Forcing database setup.'); GFForms::setup_database(); } }
/** * Import * * @since 0.0.15 * @return void */ public function import() { global $wpdb; if (class_exists('GFForms')) { $table_name = $wpdb->prefix . 'rg_form_meta'; if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") != $table_name) { GFForms::setup_database(); } if (!$this->if_form_exists($this->form_name)) { $form = GFExport::import_file($this->filepath); do_action('gform_forms_post_import', $form); } } }