/** * Includes the Patchwork library main file */ function wpbrowser_include_patchwork() { require_once wpbrowser_vendor_path('antecedent/patchwork/Patchwork.php'); }
<?php // for phar if (file_exists(__DIR__ . '/vendor/autoload.php')) { require_once __DIR__ . '/vendor/autoload.php'; } elseif (file_exists(__DIR__ . '/../../autoload.php')) { require_once __DIR__ . '/../../autoload.php'; } // Include Codeception own autoload.php file require_once wpbrowser_vendor_path('codeception/codeception/autoload.php');
$PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php'; if ("1" == getenv('WP_MULTISITE') || defined('WP_TESTS_MULTISITE') && WP_TESTS_MULTISITE) { $multisite = true; } else { $multisite = false; } // Override the PHPMailer require_once dirname(__FILE__) . '/mock-mailer.php'; $phpmailer = new MockPHPMailer(); $table_prefix = WP_TESTS_TABLE_PREFIX; // in place of executing the installation script require the (modified) installation file if (!defined('WPCEPT_ISOLATED_INSTALL') || false === WPCEPT_ISOLATED_INSTALL) { codecept_debug('Installing WordPress in same process...'); require 'same-scope-install.php'; } else { $environment = ['autoload' => wpbrowser_vendor_path('autoload.php'), 'constants' => ['ABSPATH' => ABSPATH, 'WP_DEBUG' => true, 'WP_TESTS_TABLE_PREFIX' => WP_TESTS_TABLE_PREFIX, 'DB_NAME' => DB_NAME, 'DB_USER' => DB_USER, 'DB_PASSWORD' => DB_PASSWORD, 'DB_HOST' => DB_HOST, 'DB_CHARSET' => DB_CHARSET, 'DB_COLLATE' => DB_COLLATE, 'WP_TESTS_DOMAIN' => WP_TESTS_DOMAIN, 'WP_TESTS_EMAIL' => WP_TESTS_EMAIL, 'WP_TESTS_TITLE' => WP_TESTS_TITLE, 'WP_PHP_BINARY' => WP_PHP_BINARY, 'WPLANG' => WPLANG]]; // Try to pick up extra WP constants with a fuzzy search foreach (get_defined_constants() as $key => $value) { if (isset($environment['constants'][$key])) { continue; } if (strpos($key, 'WP') === 0) { $environment['constants'][$key] = $value; } } if (!empty($GLOBALS['wp_tests_options']['active_plugins'])) { $uniqueActivePlugins = array_unique($GLOBALS['wp_tests_options']['active_plugins']); $environment['activePlugins'] = $uniqueActivePlugins; codecept_debug("Active plugins:\n\t- " . implode("\n\t- ", $uniqueActivePlugins)); } codecept_debug('Installing WordPress in isolated process...');