Codeception\Module\WPLoader::defineGlobals PHP Метод

defineGlobals() защищенный Метод

The method replaces the "wp-tests-config.php" file the original testing workflow included to allow run-time customization of the globals in a Codeception friendly way.
protected defineGlobals ( ) : void
Результат void
    protected function defineGlobals()
    {
        $wpRootFolder = $this->getWpRootFolder();
        // load an extra config file if any
        $this->loadConfigFile();
        $constants = ['WPCEPT_ISOLATED_INSTALL' => $this->requiresIsolatedInstallation(), 'ABSPATH' => $wpRootFolder, 'DB_NAME' => $this->config['dbName'], 'DB_USER' => $this->config['dbUser'], 'DB_PASSWORD' => $this->config['dbPassword'], 'DB_HOST' => $this->config['dbHost'], 'DB_CHARSET' => $this->config['dbCharset'], 'DB_COLLATE' => $this->config['dbCollate'], 'WP_TESTS_TABLE_PREFIX' => $this->config['tablePrefix'], 'WP_TESTS_DOMAIN' => $this->config['domain'], 'WP_TESTS_EMAIL' => $this->config['adminEmail'], 'WP_TESTS_TITLE' => $this->config['title'], 'WP_PHP_BINARY' => $this->config['phpBinary'], 'WPLANG' => $this->config['language'], 'WP_DEBUG' => $this->config['wpDebug'], 'WP_TESTS_MULTISITE' => $this->config['multisite']];
        foreach ($constants as $key => $value) {
            if (!defined($key)) {
                define($key, $value);
            }
        }
    }