Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
bootstrap.php 918 B
<?php
/**
 * PHPUnit bootstrap file
 *
 * @package Camo_Image_Proxy
 */

$camo_tests_dir = getenv( 'WP_TESTS_DIR' );

if ( ! $camo_tests_dir ) {
	$camo_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib';
}

if ( ! file_exists( $camo_tests_dir . '/includes/functions.php' ) ) {
	echo "Could not find $camo_tests_dir/includes/functions.php, have you run bin/install-wp-tests.sh ?" . PHP_EOL; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
	exit( 1 );
}

// Give access to tests_add_filter() function.
require_once $camo_tests_dir . '/includes/functions.php';

/**
 * Manually load the plugin being tested.
 */
function camo_manually_load_plugin() {
	require dirname( dirname( __FILE__ ) ) . '/camo-image-proxy.php';
}
tests_add_filter( 'muplugins_loaded', 'camo_manually_load_plugin' );

// Start up the WP testing environment.
require $camo_tests_dir . '/includes/bootstrap.php';