Ejemplo n.º 1
0
 function setUp()
 {
     global $gpdb;
     $gpdb->suppress_errors = false;
     $gpdb->show_errors = false;
     if (defined('GP_DEBUG') && GP_DEBUG) {
         if (defined('E_DEPRECATED')) {
             error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
         } else {
             error_reporting(E_ALL);
         }
     }
     ini_set('display_errors', 1);
     if (!gp_const_get('GP_IS_TEST_DB_INSTALLED')) {
         $gpdb->query('DROP DATABASE ' . GPDB_NAME . ";");
         $gpdb->query('CREATE DATABASE ' . GPDB_NAME . ";");
         $gpdb->select(GPDB_NAME, $gpdb->dbh);
         $gpdb->query('SET storage_engine = INNODB;');
         $errors = gp_install();
         if ($errors) {
             gp_error_log_dump($errors);
             die('ERROR: gp_install() returned errors! Check the error_log for complete SQL error message');
         }
         define('GP_IS_TEST_DB_INSTALLED', true);
     }
     $this->factory = new GP_UnitTest_Factory();
     $this->clean_up_global_scope();
     $this->start_transaction();
     ini_set('display_errors', 1);
     $this->url_filter = returner($this->url);
     add_filter('gp_get_option_uri', $this->url_filter);
 }
Ejemplo n.º 2
0
 function setUp()
 {
     global $gpdb;
     error_reporting(E_ALL);
     $gpdb->query("DROP DATABASE " . GPDB_NAME . ";");
     $gpdb->query("CREATE DATABASE " . GPDB_NAME . ";");
     $gpdb->select(GPDB_NAME, $gpdb->dbh);
     gp_install();
     wp_cache_flush();
     ini_set('display_errors', 1);
 }
Ejemplo n.º 3
0
             $errors[] = __('Please provide a valid username.');
         } elseif ($user_name != sanitize_user($user_name, true)) {
             $errors[] = __('The username you provided has invalid characters.');
         } elseif (empty($admin_password)) {
             $errors[] = __('Please specify a password.');
         } elseif ($admin_password != $admin_password_check) {
             $errors[] = __('Your passwords do not match. Please try again.');
         } else {
             if (empty($admin_email)) {
                 $errors[] = __('You must provide an email address.');
             } elseif (!is_email($admin_email)) {
                 $errors[] = __('You have an invalid email Address.');
             }
         }
         if (!$errors) {
             $errors = gp_install();
             $success_message = __('GlotPress was successully installed!');
             $success_message .= ' <a href="' . gp_url_login() . '">' . __('Log in') . '</a>';
             if (!$errors) {
                 gp_create_initial_contents($user_name, $admin_password, $admin_email);
             }
             $show_htaccess_instructions = !gp_set_htaccess() && empty($errors);
             $action = 'installed';
         } else {
             $action = 'install';
         }
     } else {
         $action = 'install';
         $user_name = $admin_email = '';
     }
 }