From 7987abfd1e933d6753fde1b064ea8cb7f301635c Mon Sep 17 00:00:00 2001 From: Paul Sealock Date: Thu, 21 Nov 2019 13:23:27 +1300 Subject: [PATCH] phpcs errors --- tests/bootstrap.php | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index d8d3812a11c..eb4a9d57af5 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -3,6 +3,11 @@ * WooCommerce Unit Tests Bootstrap * * @since 2.2 + * @package WooCommerce Tests + */ + +/** + * Class WC_Unit_Tests_Bootstrap */ class WC_Unit_Tests_Bootstrap { @@ -25,10 +30,10 @@ class WC_Unit_Tests_Bootstrap { */ public function __construct() { - // phpcs:disable WordPress.PHP.DiscouragedPHPFunctions, WordPress.PHP.DevelopmentFunctions - ini_set( 'display_errors', 'on' ); + // phpcs:disable + ini_set( 'display_errors', 'on' ); // @codingStandardsIgnoreLine error_reporting( E_ALL ); - // phpcs:enable WordPress.PHP.DiscouragedPHPFunctions, WordPress.PHP.DevelopmentFunctions + // phpcs:enable // Ensure server variable is set for WP email functions. // phpcs:disable WordPress.VIP.SuperGlobalInputUsage.AccessDetected @@ -41,19 +46,19 @@ class WC_Unit_Tests_Bootstrap { $this->plugin_dir = dirname( $this->tests_dir ); $this->wp_tests_dir = getenv( 'WP_TESTS_DIR' ) ? getenv( 'WP_TESTS_DIR' ) : '/tmp/wordpress-tests-lib'; - // load test function so tests_add_filter() is available + // load test function so tests_add_filter() is available. require_once $this->wp_tests_dir . '/includes/functions.php'; - // load WC + // load WC. tests_add_filter( 'muplugins_loaded', array( $this, 'load_wc' ) ); - // install WC + // install WC. tests_add_filter( 'setup_theme', array( $this, 'install_wc' ) ); - // load the WP testing environment + // load the WP testing environment. require_once $this->wp_tests_dir . '/includes/bootstrap.php'; - // load WC testing framework + // load WC testing framework. $this->includes(); } @@ -86,7 +91,7 @@ class WC_Unit_Tests_Bootstrap { \Automattic\WooCommerce\Admin\Install::create_tables(); \Automattic\WooCommerce\Admin\Install::create_events(); - // Reload capabilities after install, see https://core.trac.wordpress.org/ticket/28374 + // Reload capabilities after install, see https://core.trac.wordpress.org/ticket/28374. if ( version_compare( $GLOBALS['wp_version'], '4.7', '<' ) ) { $GLOBALS['wp_roles']->reinit(); } else { @@ -104,7 +109,7 @@ class WC_Unit_Tests_Bootstrap { */ public function includes() { - // framework + // framework. require_once $this->tests_dir . '/framework/class-wc-unit-test-factory.php'; require_once $this->tests_dir . '/framework/class-wc-mock-session-handler.php'; require_once $this->tests_dir . '/framework/class-wc-mock-wc-data.php'; @@ -113,13 +118,13 @@ class WC_Unit_Tests_Bootstrap { require_once $this->tests_dir . '/framework/class-wc-payment-token-stub.php'; require_once $this->tests_dir . '/framework/vendor/class-wp-test-spy-rest-server.php'; - // test cases + // test cases. require_once $this->tests_dir . '/includes/wp-http-testcase.php'; require_once $this->tests_dir . '/framework/class-wc-unit-test-case.php'; require_once $this->tests_dir . '/framework/class-wc-api-unit-test-case.php'; require_once $this->tests_dir . '/framework/class-wc-rest-unit-test-case.php'; - // Helpers + // Helpers. require_once $this->tests_dir . '/framework/helpers/class-wc-helper-product.php'; require_once $this->tests_dir . '/framework/helpers/class-wc-helper-coupon.php'; require_once $this->tests_dir . '/framework/helpers/class-wc-helper-fee.php';