From c524d1b21bc569fa2ea267b64f97a02ab2cc3475 Mon Sep 17 00:00:00 2001 From: Ian Dunn Date: Thu, 7 Nov 2019 11:16:12 -0800 Subject: [PATCH] Tests: Disable logger to avoid errors. --- plugins/wporg-5ftf/index.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/wporg-5ftf/index.php b/plugins/wporg-5ftf/index.php index 42f6377..a69b2da 100755 --- a/plugins/wporg-5ftf/index.php +++ b/plugins/wporg-5ftf/index.php @@ -23,14 +23,20 @@ add_action( 'plugins_loaded', __NAMESPACE__ . '\load' ); * Include the rest of the plugin. */ function load() { + $running_unit_tests = isset( $_SERVER['_'] ) && false !== strpos( $_SERVER['_'], 'phpunit' ); + require_once get_includes_path() . 'contributor.php'; require_once get_includes_path() . 'email.php'; require_once get_includes_path() . 'pledge.php'; require_once get_includes_path() . 'pledge-meta.php'; require_once get_includes_path() . 'pledge-form.php'; require_once get_includes_path() . 'xprofile.php'; - require_once get_includes_path() . 'pledge-log.php'; require_once get_includes_path() . 'miscellaneous.php'; + + // The logger expects things like `$_POST` which aren't set during unit tests. + if ( ! $running_unit_tests ) { + require_once get_includes_path() . 'pledge-log.php'; + } } /**