VersionPress\Tests\Utils\DBAsserter::defineGlobalVariables PHP Method

defineGlobalVariables() private static method

It's not pretty, but makes the mapping functions very flexible (they can have various dependecies).
private static defineGlobalVariables ( )
    private static function defineGlobalVariables()
    {
        global $versionPressContainer, $wpdb, $wp_taxonomies;
        defined('VERSIONPRESS_PLUGIN_DIR') || define('VERSIONPRESS_PLUGIN_DIR', self::$testConfig->testSite->path . '/wp-content/plugins/versionpress');
        defined('VP_VPDB_DIR') || define('VP_VPDB_DIR', self::$testConfig->testSite->path . '/wp-content/vpdb');
        $versionPressContainer = DIContainer::getConfiguredInstance();
        $wpdb = self::$wpdb;
        $rawTaxonomies = self::$wpAutomation->runWpCliCommand('taxonomy', 'list', ['format' => 'json', 'fields' => 'name']);
        $taxonomies = array_column(json_decode($rawTaxonomies, true), 'name');
        $wp_taxonomies = array_combine($taxonomies, $taxonomies);
    }