wp-discourse/tests/phpunit/bootstrap.php
Angus McLeod deacab2662
Update and improve webhooks (#519)
* 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
2024-06-19 09:08:22 -07:00

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';