Files
chrnx-dev-wp/tests/php/bootstrap.php
T

29 lines
712 B
PHP

<?php
/**
* PHPUnit bootstrap for the CHRNX theme.
*
* @package CHRNX
*/
$chrnx_tests_dir = getenv( 'WP_TESTS_DIR' );
if ( ! $chrnx_tests_dir ) {
$chrnx_tests_dir = '/wordpress-phpunit';
}
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound
define( 'WP_TESTS_PHPUNIT_POLYFILLS_PATH', dirname( __DIR__, 2 ) . '/vendor/yoast/phpunit-polyfills' );
require_once $chrnx_tests_dir . '/includes/functions.php';
/**
* Activate the mapped theme before WordPress finishes bootstrapping.
*/
function chrnx_tests_load_theme() {
switch_theme( 'chrnx' );
}
tests_add_filter( 'muplugins_loaded', 'chrnx_tests_load_theme' );
require $chrnx_tests_dir . '/includes/bootstrap.php';