Codeception\Module\WPBootstrapper::bootstrapWp PHP Method

bootstrapWp() public method

public bootstrapWp ( )
    public function bootstrapWp()
    {
        include_once $this->wpLoadPath;
        if ($this->config['backupGlobals']) {
            if ($this->globalStateSnapshot === false) {
                $this->setupSuperglobalArrays();
                $this->unsetGlobalClosures();
                $this->globalStateSnapshot = new Snapshot();
                codecept_debug('WPBootstrapper: backed up global state.');
            } else {
                $this->restorer->restoreGlobalVariables($this->globalStateSnapshot);
                $this->restorer->restoreStaticAttributes($this->globalStateSnapshot);
                $this->restoreAllGlobals();
                $this->restoreWpdbConnection();
                codecept_debug('WPBootstrapper: restored global state.');
            }
        }
        codecept_debug('WPBootstrappper: WordPress bootstrapped from wp-load.php file');
        // prevent WordPress from trying to update when bootstrapping
        foreach (['update_core', 'update_plugins', 'update_themes'] as $key) {
            $this->wp->set_site_transient($key, (object) ['last_checked' => time() + 86400]);
        }
        sleep(1);
    }