mirror of
https://gh.wpcy.net/https://github.com/discourse/wp-discourse.git
synced 2026-05-24 04:53:57 +08:00
* Update and improve webhooks Changes: - Add email matching as an identification basis for Update Userdata webhook. - Standardise webhook data processing and responses. - Add get_discourse_webhook_data utility method. - Improve Webhook admin panel UX and descriptions. Misc: - Update phpcs usage * Fix php 5.6 and 7.0 syntax checks * Fix phpcs issues arising from update * Remove ineffective nbsp from admin page
37 lines
1.1 KiB
PHP
Vendored
37 lines
1.1 KiB
PHP
Vendored
<?php
|
|
/**
|
|
* PHPUnit bootstrap file
|
|
*
|
|
* @package WPDiscourse
|
|
*/
|
|
|
|
$_tests_dir = getenv( 'WP_TESTS_DIR' );
|
|
|
|
if ( ! $_tests_dir ) {
|
|
$_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib';
|
|
}
|
|
|
|
if ( ! file_exists( $_tests_dir . '/includes/functions.php' ) ) {
|
|
echo "Could not find $_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 $_tests_dir . '/includes/functions.php';
|
|
|
|
/**
|
|
* Manually load the plugin being tested.
|
|
*/
|
|
function _manually_load_plugin() {
|
|
require dirname( __DIR__ ) . '/../wp-discourse.php';
|
|
}
|
|
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
|
|
|
|
// Start up the WP testing environment.
|
|
require $_tests_dir . '/includes/bootstrap.php';
|
|
|
|
require __DIR__ . '/../../vendor/autoload.php';
|
|
require __DIR__ . '/helpers/logging.php';
|
|
require __DIR__ . '/helpers/remote-post.php';
|
|
require __DIR__ . '/helpers/multisite.php';
|
|
require __DIR__ . '/unit-test.php';
|