Tests: Disable logger to avoid errors.

This commit is contained in:
Ian Dunn 2019-11-07 11:16:12 -08:00
parent ffebacb42a
commit c524d1b21b
No known key found for this signature in database
GPG key ID: 99B971B50343CBCB

View file

@ -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';
}
}
/**