From 0766ed6ff72c1e5263b946b378381f37f10305ed Mon Sep 17 00:00:00 2001 From: Steve Grunwell Date: Mon, 22 Jan 2018 03:34:13 +0000 Subject: [PATCH] Fix (or whitelist) coding standards violations in the test bootstrap file --- tests/bootstrap.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 06f038af7c5..86812b352fe 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -25,13 +25,17 @@ class WC_Unit_Tests_Bootstrap { */ public function __construct() { - ini_set( 'display_errors','on' ); + // phpcs:disable WordPress.PHP.DiscouragedPHPFunctions, WordPress.PHP.DevelopmentFunctions + ini_set( 'display_errors', 'on' ); error_reporting( E_ALL ); + // phpcs:enable WordPress.PHP.DiscouragedPHPFunctions, WordPress.PHP.DevelopmentFunctions // Ensure server variable is set for WP email functions. + // phpcs:disable WordPress.VIP.SuperGlobalInputUsage.AccessDetected if ( ! isset( $_SERVER['SERVER_NAME'] ) ) { $_SERVER['SERVER_NAME'] = 'localhost'; } + // phpcs:enable WordPress.VIP.SuperGlobalInputUsage.AccessDetected $this->tests_dir = dirname( __FILE__ ); $this->plugin_dir = dirname( $this->tests_dir ); @@ -81,11 +85,11 @@ class WC_Unit_Tests_Bootstrap { if ( version_compare( $GLOBALS['wp_version'], '4.7', '<' ) ) { $GLOBALS['wp_roles']->reinit(); } else { - $GLOBALS['wp_roles'] = null; + $GLOBALS['wp_roles'] = null; // WPCS: override ok. wp_roles(); } - echo 'Installing WooCommerce...' . PHP_EOL; + echo esc_html( 'Installing WooCommerce...' . PHP_EOL ); } /**