From 01073ec24ff7448d619a25d35b27003f74f0ab51 Mon Sep 17 00:00:00 2001 From: Nestor Soriano Date: Fri, 18 Mar 2022 11:50:38 +0100 Subject: [PATCH] Add return type setUp and tearDown methods in unit tests After the bump to PHP 7.2 all the setUp and tearDown methods in unit test classes need to have an explicit "void" return type declaration. --- .../legacy/framework/class-wc-api-unit-test-case.php | 2 +- .../legacy/framework/class-wc-rest-unit-test-case.php | 4 ++-- .../tests/legacy/framework/class-wc-unit-test-case.php | 4 ++-- .../tests/legacy/includes/wp-http-testcase.php | 8 ++++---- .../tests/legacy/unit-tests/account/permissions.php | 4 ++-- .../unit-tests/admin/class-wc-tests-admin-dashboard.php | 4 ++-- .../admin/notes/class-wc-tests-notes-run-db-update.php | 4 ++-- .../admin/reports/class-wc-tests-admin-report.php | 2 +- .../admin/reports/class-wc-tests-report-sales-by-date.php | 2 +- plugins/woocommerce/tests/legacy/unit-tests/cart/cart.php | 2 +- .../tests/legacy/unit-tests/checkout/checkout.php | 4 ++-- .../tests/legacy/unit-tests/core/main-class.php | 2 +- .../tests/legacy/unit-tests/core/post-types-admin.php | 2 +- .../woocommerce/tests/legacy/unit-tests/coupon/coupon.php | 4 ++-- plugins/woocommerce/tests/legacy/unit-tests/crud/data.php | 2 +- .../customer/class-wc-tests-customer-download.php | 2 +- .../tests/legacy/unit-tests/customer/functions.php | 2 +- .../tests/legacy/unit-tests/discounts/discounts.php | 4 ++-- .../woocommerce/tests/legacy/unit-tests/email/emails.php | 2 +- .../tests/legacy/unit-tests/exporter/product.php | 2 +- .../tests/legacy/unit-tests/formatting/functions.php | 2 +- .../tests/legacy/unit-tests/gateways/paypal/request.php | 2 +- .../tests/legacy/unit-tests/importer/product.php | 2 +- .../woocommerce/tests/legacy/unit-tests/importer/tax.php | 2 +- .../class-wc-tests-maxmind-database.php | 2 +- .../class-wc-tests-maxmind-integration.php | 2 +- .../tests/legacy/unit-tests/log/log-handler-db.php | 2 +- .../tests/legacy/unit-tests/log/log-handler-email.php | 4 ++-- .../tests/legacy/unit-tests/log/log-handler-file.php | 2 +- .../legacy/unit-tests/order-items/order-item-meta.php | 2 +- .../tests/legacy/unit-tests/payment-gateways/cod.php | 2 +- .../unit-tests/payment-gateways/payment-gateways.php | 4 ++-- .../legacy/unit-tests/payment-tokens/payment-tokens.php | 2 +- .../tests/legacy/unit-tests/privacy/export.php | 2 +- .../legacy/unit-tests/product/class-wc-tests-product.php | 2 +- .../tests/legacy/unit-tests/product/product-simple.php | 2 +- .../legacy/unit-tests/rest-api/AbstractRestApiTest.php | 2 +- .../legacy/unit-tests/rest-api/Tests/Version2/coupons.php | 2 +- .../unit-tests/rest-api/Tests/Version2/customers.php | 2 +- .../legacy/unit-tests/rest-api/Tests/Version2/orders.php | 2 +- .../rest-api/Tests/Version2/payment-gateways.php | 2 +- .../rest-api/Tests/Version2/product-reviews.php | 2 +- .../rest-api/Tests/Version2/product-variations.php | 2 +- .../unit-tests/rest-api/Tests/Version2/products.php | 2 +- .../unit-tests/rest-api/Tests/Version2/settings.php | 2 +- .../rest-api/Tests/Version2/shipping-methods.php | 2 +- .../unit-tests/rest-api/Tests/Version2/shipping-zones.php | 2 +- .../unit-tests/rest-api/Tests/Version2/system-status.php | 2 +- .../legacy/unit-tests/rest-api/Tests/Version3/coupons.php | 2 +- .../unit-tests/rest-api/Tests/Version3/customers.php | 2 +- .../legacy/unit-tests/rest-api/Tests/Version3/orders.php | 2 +- .../rest-api/Tests/Version3/payment-gateways.php | 2 +- .../rest-api/Tests/Version3/product-reviews.php | 2 +- .../rest-api/Tests/Version3/product-variations.php | 2 +- .../unit-tests/rest-api/Tests/Version3/products.php | 2 +- .../rest-api/Tests/Version3/reports-coupons-totals.php | 2 +- .../rest-api/Tests/Version3/reports-customers-totals.php | 2 +- .../rest-api/Tests/Version3/reports-orders-totals.php | 2 +- .../rest-api/Tests/Version3/reports-products-totals.php | 2 +- .../rest-api/Tests/Version3/reports-reviews-totals.php | 2 +- .../unit-tests/rest-api/Tests/Version3/settings.php | 2 +- .../rest-api/Tests/Version3/shipping-methods.php | 2 +- .../unit-tests/rest-api/Tests/Version3/shipping-zones.php | 2 +- .../unit-tests/rest-api/Tests/Version3/system-status.php | 2 +- .../unit-tests/session/class-wc-tests-session-handler.php | 2 +- .../unit-tests/settings/register-wp-admin-settings.php | 2 +- .../tests/legacy/unit-tests/shipping/shipping-zone.php | 2 +- .../tests/legacy/unit-tests/shipping/shipping-zones.php | 2 +- .../woocommerce/tests/legacy/unit-tests/totals/totals.php | 4 ++-- .../tests/legacy/unit-tests/util/api-functions.php | 4 ++-- .../legacy/unit-tests/util/class-wc-rate-limiter.php | 4 ++-- .../unit-tests/util/class-wc-tests-core-functions.php | 2 +- .../tests/legacy/unit-tests/util/deprecated-hooks.php | 2 +- .../tests/legacy/unit-tests/util/notice-functions.php | 2 +- .../tests/legacy/unit-tests/util/plugin-updates.php | 2 +- .../admin/class-wc-admin-dashboard-setup-test.php | 6 +++--- .../php/includes/admin/class-wc-admin-functions-test.php | 2 +- .../php/includes/admin/helper/class-wc-helper-api.php | 2 +- .../class-wc-product-csv-importer-controller-test.php | 2 +- .../woocommerce/tests/php/includes/class-wc-cart-test.php | 2 +- .../tests/php/includes/class-wc-checkout-test.php | 2 +- .../exporter/class-wc-product-csv-exporter-test.php | 2 +- .../importer/class-wc-product-csv-importer-test.php | 2 +- ...ass-wc-rest-product-attributes-v1-controller-tests.php | 2 +- .../class-wc-rest-product-reviews-v1-controller-tests.php | 2 +- .../Version2/class-wc-rest-orders-v2-controller-test.php | 2 +- .../class-wc-rest-product-reviews-v2-controller-tests.php | 2 +- .../Version2/class-wc-rest-products-controller-tests.php | 2 +- .../Version3/class-wc-rest-coupons-controller-tests.php | 2 +- .../Version3/class-wc-rest-orders-controller-tests.php | 2 +- .../class-wc-rest-product-reviews-controller-tests.php | 2 +- .../Version3/class-wc-rest-products-controller-tests.php | 2 +- .../Version3/class-wc-rest-taxes-controller-tests.php | 2 +- .../Version3/class-wc-rest-terms-controller-tests.php | 2 +- .../tests/php/includes/wc-attribute-functions-test.php | 4 ++-- .../DependencyManagement/AbstractServiceProviderTest.php | 4 ++-- .../DependencyManagement/ExtendedContainerTest.php | 2 +- .../php/src/Internal/DownloadPermissionsAdjusterTest.php | 2 +- .../ProductAttributesLookup/DataRegeneratorTest.php | 2 +- .../src/Internal/ProductAttributesLookup/FiltererTest.php | 4 ++-- .../ProductAttributesLookup/LookupDataStoreTest.php | 4 ++-- .../ProductDownloads/ApprovedDirectories/RegisterTest.php | 2 +- .../ApprovedDirectories/SynchronizeTest.php | 2 +- .../php/src/Proxies/ClassThatDependsOnLegacyCodeTest.php | 2 +- .../woocommerce/tests/php/src/Proxies/LegacyProxyTest.php | 2 +- .../tests/php/src/Proxies/MockableLegacyProxyTest.php | 2 +- 106 files changed, 128 insertions(+), 128 deletions(-) diff --git a/plugins/woocommerce/tests/legacy/framework/class-wc-api-unit-test-case.php b/plugins/woocommerce/tests/legacy/framework/class-wc-api-unit-test-case.php index edb3a7f73c8..587c663a72a 100644 --- a/plugins/woocommerce/tests/legacy/framework/class-wc-api-unit-test-case.php +++ b/plugins/woocommerce/tests/legacy/framework/class-wc-api-unit-test-case.php @@ -21,7 +21,7 @@ class WC_API_Unit_Test_Case extends WC_Unit_Test_Case { * @since 2.2 * @see WC_Unit_Test_Case::setUp() */ - public function setUp() { + public function setUp(): void { parent::setUp(); diff --git a/plugins/woocommerce/tests/legacy/framework/class-wc-rest-unit-test-case.php b/plugins/woocommerce/tests/legacy/framework/class-wc-rest-unit-test-case.php index 013ec0ace8d..df7eec8f406 100644 --- a/plugins/woocommerce/tests/legacy/framework/class-wc-rest-unit-test-case.php +++ b/plugins/woocommerce/tests/legacy/framework/class-wc-rest-unit-test-case.php @@ -21,7 +21,7 @@ class WC_REST_Unit_Test_Case extends WC_Unit_Test_Case { /** * Setup our test server. */ - public function setUp() { + public function setUp(): void { parent::setUp(); global $wp_rest_server; $wp_rest_server = new WP_Test_Spy_REST_Server(); @@ -37,7 +37,7 @@ class WC_REST_Unit_Test_Case extends WC_Unit_Test_Case { /** * Unset the server. */ - public function tearDown() { + public function tearDown(): void { parent::tearDown(); global $wp_rest_server; unset( $this->server ); diff --git a/plugins/woocommerce/tests/legacy/framework/class-wc-unit-test-case.php b/plugins/woocommerce/tests/legacy/framework/class-wc-unit-test-case.php index 0cb9a0830a2..6cf474d86a6 100644 --- a/plugins/woocommerce/tests/legacy/framework/class-wc-unit-test-case.php +++ b/plugins/woocommerce/tests/legacy/framework/class-wc-unit-test-case.php @@ -62,7 +62,7 @@ class WC_Unit_Test_Case extends WP_HTTP_TestCase { * * @since 2.2 */ - public function setUp() { + public function setUp(): void { parent::setUp(); @@ -90,7 +90,7 @@ class WC_Unit_Test_Case extends WP_HTTP_TestCase { * * @since 3.5.0 */ - public static function setUpBeforeClass() { + public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); // Terms are deleted in WP_UnitTestCase::tearDownAfterClass, then e.g. Uncategorized product_cat is missing. diff --git a/plugins/woocommerce/tests/legacy/includes/wp-http-testcase.php b/plugins/woocommerce/tests/legacy/includes/wp-http-testcase.php index 7878c21dc48..d03277392e0 100644 --- a/plugins/woocommerce/tests/legacy/includes/wp-http-testcase.php +++ b/plugins/woocommerce/tests/legacy/includes/wp-http-testcase.php @@ -134,7 +134,7 @@ abstract class WP_HTTP_TestCase extends WP_UnitTestCase { /** * @since 1.3.0 */ - public static function setUpBeforeClass() { + public static function setUpBeforeClass(): void { if ( ! self::$did_init ) { self::init(); @@ -146,7 +146,7 @@ abstract class WP_HTTP_TestCase extends WP_UnitTestCase { /** * @since 1.3.1 */ - public static function tearDownAfterClass() { + public static function tearDownAfterClass(): void { self::save_cache(); @@ -158,7 +158,7 @@ abstract class WP_HTTP_TestCase extends WP_UnitTestCase { * * @since 1.0.0 */ - public function setUp() { + public function setUp(): void { parent::setUp(); @@ -176,7 +176,7 @@ abstract class WP_HTTP_TestCase extends WP_UnitTestCase { * * @since 1.0.0 */ - public function tearDown() { + public function tearDown(): void { parent::tearDown(); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/account/permissions.php b/plugins/woocommerce/tests/legacy/unit-tests/account/permissions.php index 8b2285dd916..3a2ec0355f6 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/account/permissions.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/account/permissions.php @@ -13,7 +13,7 @@ class WC_Tests_Account_Permissions extends WC_Unit_Test_Case { * Setup: * 1. Set current user to zero to simulate not logged in state. */ - public function setUp() { + public function setUp(): void { parent::setUp(); wp_set_current_user( 0 ); } @@ -22,7 +22,7 @@ class WC_Tests_Account_Permissions extends WC_Unit_Test_Case { * Teardown: * 1. Set current user to 0 because we change current user in some tests. */ - public function tearDown() { + public function tearDown(): void { wp_set_current_user( 0 ); parent::tearDown(); } diff --git a/plugins/woocommerce/tests/legacy/unit-tests/admin/class-wc-tests-admin-dashboard.php b/plugins/woocommerce/tests/legacy/unit-tests/admin/class-wc-tests-admin-dashboard.php index 0f43d57e2a2..56b0e4cd6ca 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/admin/class-wc-tests-admin-dashboard.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/admin/class-wc-tests-admin-dashboard.php @@ -13,7 +13,7 @@ class WC_Tests_Admin_Dashboard extends WC_Unit_Test_Case { /** * Set up for tests. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->user = $this->factory->user->create( array( @@ -28,7 +28,7 @@ class WC_Tests_Admin_Dashboard extends WC_Unit_Test_Case { /** * Tear down. */ - public function tearDown() { + public function tearDown(): void { parent::tearDown(); remove_filter( 'rest_pre_dispatch', array( $this, 'mock_rest_responses' ), 10 ); } diff --git a/plugins/woocommerce/tests/legacy/unit-tests/admin/notes/class-wc-tests-notes-run-db-update.php b/plugins/woocommerce/tests/legacy/unit-tests/admin/notes/class-wc-tests-notes-run-db-update.php index 6d272326578..df8411e96ac 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/admin/notes/class-wc-tests-notes-run-db-update.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/admin/notes/class-wc-tests-notes-run-db-update.php @@ -16,7 +16,7 @@ class WC_Tests_Notes_Run_Db_Update extends WC_Unit_Test_Case { * Load the necessary files, as they're not automatically loaded by WooCommerce. * */ - public static function setUpBeforeClass() { + public static function setUpBeforeClass(): void { include_once WC_Unit_Tests_Bootstrap::instance()->plugin_dir . '/includes/admin/wc-admin-functions.php'; include_once WC_Unit_Tests_Bootstrap::instance()->plugin_dir . '/includes/admin/notes/class-wc-notes-run-db-update.php'; @@ -25,7 +25,7 @@ class WC_Tests_Notes_Run_Db_Update extends WC_Unit_Test_Case { /** * Clean up before each test. */ - public function setUp() { + public function setUp(): void { if ( ! WC()->is_wc_admin_active() ) { $this->markTestSkipped( 'WC Admin is not active on WP versions < 5.3' ); return; diff --git a/plugins/woocommerce/tests/legacy/unit-tests/admin/reports/class-wc-tests-admin-report.php b/plugins/woocommerce/tests/legacy/unit-tests/admin/reports/class-wc-tests-admin-report.php index 332e0630399..480af399bdc 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/admin/reports/class-wc-tests-admin-report.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/admin/reports/class-wc-tests-admin-report.php @@ -14,7 +14,7 @@ class WC_Tests_Admin_Report extends WC_Unit_Test_Case { * Load the necessary files, as they're not automatically loaded by WooCommerce. * */ - public static function setUpBeforeClass() { + public static function setUpBeforeClass(): void { include_once WC_Unit_Tests_Bootstrap::instance()->plugin_dir . '/includes/admin/reports/class-wc-admin-report.php'; } diff --git a/plugins/woocommerce/tests/legacy/unit-tests/admin/reports/class-wc-tests-report-sales-by-date.php b/plugins/woocommerce/tests/legacy/unit-tests/admin/reports/class-wc-tests-report-sales-by-date.php index 763dd7820ac..8f3364deb11 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/admin/reports/class-wc-tests-report-sales-by-date.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/admin/reports/class-wc-tests-report-sales-by-date.php @@ -13,7 +13,7 @@ class WC_Tests_Report_Sales_By_Date extends WC_Unit_Test_Case { /** * Load the necessary files, as they're not automatically loaded by WooCommerce. */ - public static function setUpBeforeClass() { + public static function setUpBeforeClass(): void { include_once WC_Unit_Tests_Bootstrap::instance()->plugin_dir . '/includes/admin/reports/class-wc-admin-report.php'; include_once WC_Unit_Tests_Bootstrap::instance()->plugin_dir . '/includes/admin/reports/class-wc-report-sales-by-date.php'; } diff --git a/plugins/woocommerce/tests/legacy/unit-tests/cart/cart.php b/plugins/woocommerce/tests/legacy/unit-tests/cart/cart.php index f59fbbb7a05..f0e27b38d9f 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/cart/cart.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/cart/cart.php @@ -13,7 +13,7 @@ class WC_Tests_Cart extends WC_Unit_Test_Case { /** * tearDown. */ - public function tearDown() { + public function tearDown(): void { parent::tearDown(); WC()->cart->empty_cart(); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/checkout/checkout.php b/plugins/woocommerce/tests/legacy/unit-tests/checkout/checkout.php index 953351a9350..0d273e91519 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/checkout/checkout.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/checkout/checkout.php @@ -12,7 +12,7 @@ class WC_Tests_Checkout extends WC_Unit_Test_Case { /** * TearDown. */ - public function tearDown() { + public function tearDown(): void { parent::tearDown(); WC()->cart->empty_cart(); } @@ -20,7 +20,7 @@ class WC_Tests_Checkout extends WC_Unit_Test_Case { /** * Setup. */ - public function setUp() { + public function setUp(): void { parent::setUp(); WC()->cart->empty_cart(); } diff --git a/plugins/woocommerce/tests/legacy/unit-tests/core/main-class.php b/plugins/woocommerce/tests/legacy/unit-tests/core/main-class.php index b55707573c8..bc90cbf5fce 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/core/main-class.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/core/main-class.php @@ -26,7 +26,7 @@ class WC_Test_WooCommerce extends WC_Unit_Test_Case { * * @since 2.2 */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->wc = WC(); } diff --git a/plugins/woocommerce/tests/legacy/unit-tests/core/post-types-admin.php b/plugins/woocommerce/tests/legacy/unit-tests/core/post-types-admin.php index 240bf0ca913..55c122e9f1d 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/core/post-types-admin.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/core/post-types-admin.php @@ -20,7 +20,7 @@ class WC_Test_Admin_Post_Types extends WC_Unit_Test_Case { /** * Setup. Create a instance to use throughout. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->wc_cpt = new WC_Admin_Post_Types(); } diff --git a/plugins/woocommerce/tests/legacy/unit-tests/coupon/coupon.php b/plugins/woocommerce/tests/legacy/unit-tests/coupon/coupon.php index 35b9b5d4ac4..836ca80b011 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/coupon/coupon.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/coupon/coupon.php @@ -15,7 +15,7 @@ class WC_Tests_Coupon extends WC_Unit_Test_Case { /** * Sets up the test class. */ - public function setUp() { + public function setUp(): void { parent::setUp(); // Set a valid address for the customer so shipping rates will calculate. @@ -27,7 +27,7 @@ class WC_Tests_Coupon extends WC_Unit_Test_Case { /** * Cleans up after the test class. */ - public function tearDown() { + public function tearDown(): void { WC()->cart->empty_cart(); WC()->cart->remove_coupons(); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/crud/data.php b/plugins/woocommerce/tests/legacy/unit-tests/crud/data.php index 269e37e7563..2ddddb6e3b3 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/crud/data.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/crud/data.php @@ -13,7 +13,7 @@ class WC_Tests_CRUD_Data extends WC_Unit_Test_Case { /** * Restore UTC on failure. */ - public function tearDown() { + public function tearDown(): void { parent::tearDown(); // @codingStandardsIgnoreStart date_default_timezone_set( 'UTC' ); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/customer/class-wc-tests-customer-download.php b/plugins/woocommerce/tests/legacy/unit-tests/customer/class-wc-tests-customer-download.php index 21b6c135c62..b2768c516c8 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/customer/class-wc-tests-customer-download.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/customer/class-wc-tests-customer-download.php @@ -37,7 +37,7 @@ class WC_Tests_Customer_Download extends WC_Unit_Test_Case { /** * Tests set up. */ - public function setUp() { + public function setUp(): void { $this->customer_id = 1; $this->customer_email = 'test@example.com'; diff --git a/plugins/woocommerce/tests/legacy/unit-tests/customer/functions.php b/plugins/woocommerce/tests/legacy/unit-tests/customer/functions.php index d97b091d6f6..d538f728ee2 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/customer/functions.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/customer/functions.php @@ -14,7 +14,7 @@ class WC_Tests_Customer_Functions extends WC_Unit_Test_Case { /** * Perform any common setup work. */ - public function setUp() { + public function setUp(): void { parent::setUp(); // For these tests, we are not concerned with Approved Download Directory functionality. diff --git a/plugins/woocommerce/tests/legacy/unit-tests/discounts/discounts.php b/plugins/woocommerce/tests/legacy/unit-tests/discounts/discounts.php index fbf0673e270..070fa56d1b3 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/discounts/discounts.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/discounts/discounts.php @@ -62,7 +62,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { /** * Setup tests. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->products = array(); @@ -74,7 +74,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { /** * Clean up after each test. DB changes are reverted in parent::tearDown(). */ - public function tearDown() { + public function tearDown(): void { WC()->cart->empty_cart(); WC()->cart->remove_coupons(); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/email/emails.php b/plugins/woocommerce/tests/legacy/unit-tests/email/emails.php index 6e55c3823ce..40a6b3a6333 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/email/emails.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/email/emails.php @@ -14,7 +14,7 @@ class WC_Tests_WC_Emails extends WC_Unit_Test_Case { /** * Setup tests. */ - public function setUp() { + public function setUp(): void { parent::setUp(); // Load email classes. diff --git a/plugins/woocommerce/tests/legacy/unit-tests/exporter/product.php b/plugins/woocommerce/tests/legacy/unit-tests/exporter/product.php index d0110f39ce7..0e3b7036567 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/exporter/product.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/exporter/product.php @@ -9,7 +9,7 @@ class WC_Tests_Product_CSV_Exporter extends WC_Unit_Test_Case { /** * Load up the exporter classes since they aren't loaded by default. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $bootstrap = WC_Unit_Tests_Bootstrap::instance(); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/formatting/functions.php b/plugins/woocommerce/tests/legacy/unit-tests/formatting/functions.php index ae237dacf6e..e613d9341ed 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/formatting/functions.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/formatting/functions.php @@ -15,7 +15,7 @@ class WC_Tests_Formatting_Functions extends WC_Unit_Test_Case { /** * Set up. */ - public function setUp() { + public function setUp(): void { parent::setUp(); // Callback used by WP_HTTP_TestCase to decide whether to perform HTTP requests or to provide a mocked response. diff --git a/plugins/woocommerce/tests/legacy/unit-tests/gateways/paypal/request.php b/plugins/woocommerce/tests/legacy/unit-tests/gateways/paypal/request.php index 04be4982647..bdb00d2ff26 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/gateways/paypal/request.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/gateways/paypal/request.php @@ -81,7 +81,7 @@ class WC_Tests_Paypal_Gateway_Request extends WC_Unit_Test_Case { /** * Initialize the Paypal gateway and Request objects. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $bootstrap = WC_Unit_Tests_Bootstrap::instance(); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/importer/product.php b/plugins/woocommerce/tests/legacy/unit-tests/importer/product.php index c8439b6a8bc..637506ea631 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/importer/product.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/importer/product.php @@ -25,7 +25,7 @@ class WC_Tests_Product_CSV_Importer extends WC_Unit_Test_Case { /** * Load up the importer classes since they aren't loaded by default. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $bootstrap = WC_Unit_Tests_Bootstrap::instance(); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/importer/tax.php b/plugins/woocommerce/tests/legacy/unit-tests/importer/tax.php index 5ecccbe4f13..a3f64b1fc38 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/importer/tax.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/importer/tax.php @@ -16,7 +16,7 @@ class WC_Tests_Tax_CSV_Importer extends WC_Unit_Test_Case { /** * Load up the importer classes since they aren't loaded by default. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->csv_file = dirname( __FILE__ ) . '/sample_tax_rates.csv'; diff --git a/plugins/woocommerce/tests/legacy/unit-tests/integrations/maxmind-geolocation/class-wc-tests-maxmind-database.php b/plugins/woocommerce/tests/legacy/unit-tests/integrations/maxmind-geolocation/class-wc-tests-maxmind-database.php index 6e424380a33..a1132d435be 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/integrations/maxmind-geolocation/class-wc-tests-maxmind-database.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/integrations/maxmind-geolocation/class-wc-tests-maxmind-database.php @@ -13,7 +13,7 @@ class WC_Tests_MaxMind_Database extends WC_Unit_Test_Case { /** * Run setup code for unit tests. */ - public function setUp() { + public function setUp(): void { parent::setUp(); // Callback used by WP_HTTP_TestCase to decide whether to perform HTTP requests or to provide a mocked response. diff --git a/plugins/woocommerce/tests/legacy/unit-tests/integrations/maxmind-geolocation/class-wc-tests-maxmind-integration.php b/plugins/woocommerce/tests/legacy/unit-tests/integrations/maxmind-geolocation/class-wc-tests-maxmind-integration.php index e7bbbd3e517..c2db6857516 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/integrations/maxmind-geolocation/class-wc-tests-maxmind-integration.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/integrations/maxmind-geolocation/class-wc-tests-maxmind-integration.php @@ -20,7 +20,7 @@ class WC_Tests_MaxMind_Integration extends WC_Unit_Test_Case { /** * Run setup code for unit tests. */ - public function setUp() { + public function setUp(): void { parent::setUp(); // Override the filesystem method that we're using. diff --git a/plugins/woocommerce/tests/legacy/unit-tests/log/log-handler-db.php b/plugins/woocommerce/tests/legacy/unit-tests/log/log-handler-db.php index ad776f778bf..41fb7bb813c 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/log/log-handler-db.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/log/log-handler-db.php @@ -6,7 +6,7 @@ * @since 3.0.0 */ class WC_Tests_Log_Handler_DB extends WC_Unit_Test_Case { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->handler = new WC_Log_Handler_DB( array( 'threshold' => 'debug' ) ); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/log/log-handler-email.php b/plugins/woocommerce/tests/legacy/unit-tests/log/log-handler-email.php index aef0bbec8c7..f463d3ed211 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/log/log-handler-email.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/log/log-handler-email.php @@ -15,7 +15,7 @@ class WC_Tests_Log_Handler_Email extends WC_Unit_Test_Case { /** * Test setup. */ - public function setUp() { + public function setUp(): void { parent::setUp(); reset_phpmailer_instance(); } @@ -23,7 +23,7 @@ class WC_Tests_Log_Handler_Email extends WC_Unit_Test_Case { /** * Test teardown. */ - public function tearDown() { + public function tearDown(): void { reset_phpmailer_instance(); parent::tearDown(); } diff --git a/plugins/woocommerce/tests/legacy/unit-tests/log/log-handler-file.php b/plugins/woocommerce/tests/legacy/unit-tests/log/log-handler-file.php index 60ccbf6212e..062427d815a 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/log/log-handler-file.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/log/log-handler-file.php @@ -7,7 +7,7 @@ */ class WC_Tests_Log_Handler_File extends WC_Unit_Test_Case { - public function tearDown() { + public function tearDown(): void { $log_files = array( 'unit-tests', 'log', diff --git a/plugins/woocommerce/tests/legacy/unit-tests/order-items/order-item-meta.php b/plugins/woocommerce/tests/legacy/unit-tests/order-items/order-item-meta.php index 306b7dc7c89..62a544b332d 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/order-items/order-item-meta.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/order-items/order-item-meta.php @@ -10,7 +10,7 @@ class WC_Tests_Order_Item_Meta extends WC_Unit_Test_Case { /** * Suppress deprecation notice from WC_Order_Item_Meta constructor. */ - public function setUp() { + public function setUp(): void { parent::setUp(); wp_insert_term( 'Testing Categories', 'category', array( 'slug' => 'testing' ) ); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/payment-gateways/cod.php b/plugins/woocommerce/tests/legacy/unit-tests/payment-gateways/cod.php index 8dea53d70e5..fb8edb0e136 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/payment-gateways/cod.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/payment-gateways/cod.php @@ -15,7 +15,7 @@ class WC_Tests_Payment_Gateway_COD extends WC_Unit_Test_Case { /** * Clean up after each test. */ - public function tearDown() { + public function tearDown(): void { parent::tearDown(); Constants::clear_constants(); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/payment-gateways/payment-gateways.php b/plugins/woocommerce/tests/legacy/unit-tests/payment-gateways/payment-gateways.php index 3428db4971d..960b4aeb066 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/payment-gateways/payment-gateways.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/payment-gateways/payment-gateways.php @@ -11,7 +11,7 @@ class WC_Tests_Payment_Gateway extends WC_Unit_Test_Case { /** * Setup, enable payment gateways Cash on delivery and direct bank deposit. */ - public function setUp() { + public function setUp(): void { parent::setUp(); WC()->session = null; $wc_payment_gateways = WC_Payment_Gateways::instance(); @@ -26,7 +26,7 @@ class WC_Tests_Payment_Gateway extends WC_Unit_Test_Case { /** * Initialize session that some tests might have removed. */ - public function tearDown() { + public function tearDown(): void { parent::tearDown(); WC()->initialize_session(); } diff --git a/plugins/woocommerce/tests/legacy/unit-tests/payment-tokens/payment-tokens.php b/plugins/woocommerce/tests/legacy/unit-tests/payment-tokens/payment-tokens.php index 77733684611..92f607d6df2 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/payment-tokens/payment-tokens.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/payment-tokens/payment-tokens.php @@ -15,7 +15,7 @@ class WC_Tests_Payment_Tokens extends WC_Unit_Test_Case { * * @see WC_Unit_Test_Case::setUp() */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->user_id = $this->login_as_role( 'shop_manager' ); } diff --git a/plugins/woocommerce/tests/legacy/unit-tests/privacy/export.php b/plugins/woocommerce/tests/legacy/unit-tests/privacy/export.php index 68d8b7fe85a..f6a1197a95a 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/privacy/export.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/privacy/export.php @@ -27,7 +27,7 @@ class WC_Test_Privacy_Export extends WC_Unit_Test_Case { /** * Load up the importer classes since they aren't loaded by default. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $customer1 = WC_Helper_Customer::create_customer( 'customer1', 'password', 'test1@test.com' ); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/product/class-wc-tests-product.php b/plugins/woocommerce/tests/legacy/unit-tests/product/class-wc-tests-product.php index 182f238cd1d..2753bcef6d2 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/product/class-wc-tests-product.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/product/class-wc-tests-product.php @@ -20,7 +20,7 @@ class WC_Tests_Product extends WC_Unit_Test_Case { /** * Runs before every test. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->product = new WC_Product(); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/product/product-simple.php b/plugins/woocommerce/tests/legacy/unit-tests/product/product-simple.php index c6a13677d02..fd1780943d0 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/product/product-simple.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/product/product-simple.php @@ -12,7 +12,7 @@ class WC_Tests_Product_Simple extends WC_Unit_Test_Case { */ protected $product; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->product = WC_Helper_Product::create_simple_product(); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/AbstractRestApiTest.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/AbstractRestApiTest.php index 51995975126..c93352f50e2 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/AbstractRestApiTest.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/AbstractRestApiTest.php @@ -70,7 +70,7 @@ abstract class AbstractRestApiTest extends WC_REST_Unit_Test_Case { /** * Setup test class. */ - public function setUp() { + public function setUp(): void { parent::setUp(); wp_set_current_user( self::$user ); } diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/coupons.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/coupons.php index a27af8ff246..8c1c1d50297 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/coupons.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/coupons.php @@ -12,7 +12,7 @@ class WC_Tests_API_Coupons_V2 extends WC_REST_Unit_Test_Case { * Setup test coupon data. * @since 3.0.0 */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Coupons_Controller(); $this->user = $this->factory->user->create( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/customers.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/customers.php index 94367a3c5bf..97a8d7d6773 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/customers.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/customers.php @@ -17,7 +17,7 @@ class Customers_V2 extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Customers_Controller(); } diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/orders.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/orders.php index f5bbfe66bff..ead32b074f4 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/orders.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/orders.php @@ -20,7 +20,7 @@ class WC_Tests_API_Orders_V2 extends WC_REST_Unit_Test_Case { /** * Setup our test server. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Orders_Controller(); $this->user = $this->factory->user->create( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/payment-gateways.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/payment-gateways.php index 9efbcc582b0..be3a8b09dfc 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/payment-gateways.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/payment-gateways.php @@ -14,7 +14,7 @@ class Payment_Gateways_V2 extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Payment_Gateways_Controller(); $this->user = $this->factory->user->create( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/product-reviews.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/product-reviews.php index b0f9ebd0a48..df53aeece57 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/product-reviews.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/product-reviews.php @@ -11,7 +11,7 @@ class WC_Tests_API_Product_Reviews_V2 extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->user = $this->factory->user->create( array( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/product-variations.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/product-variations.php index 560e88693ad..7ba480df05c 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/product-variations.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/product-variations.php @@ -12,7 +12,7 @@ class Product_Variations_API_V2 extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Product_Variations_Controller(); $this->user = $this->factory->user->create( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/products.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/products.php index ea67735ae4e..ff6a04de238 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/products.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/products.php @@ -14,7 +14,7 @@ class Products_API_V2 extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Products_Controller(); $this->user = $this->factory->user->create( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/settings.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/settings.php index 6117fdc87e0..9c6950ac1d6 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/settings.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/settings.php @@ -14,7 +14,7 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Setting_Options_Controller(); \Automattic\WooCommerce\RestApi\UnitTests\Helpers\SettingsHelper::register(); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/shipping-methods.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/shipping-methods.php index 65c153e8f31..3f13ecb2ee1 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/shipping-methods.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/shipping-methods.php @@ -11,7 +11,7 @@ class Shipping_Methods_V2 extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Shipping_Methods_Controller(); $this->user = $this->factory->user->create( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/shipping-zones.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/shipping-zones.php index 1d9ea5368d3..bc020791d02 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/shipping-zones.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/shipping-zones.php @@ -18,7 +18,7 @@ class WC_Tests_API_Shipping_Zones_V2 extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Shipping_Zones_Controller(); $this->user = $this->factory->user->create( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/system-status.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/system-status.php index cb359b0630b..041a3af8144 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/system-status.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/system-status.php @@ -16,7 +16,7 @@ class WC_Tests_REST_System_Status_V2 extends WC_REST_Unit_Test_Case { /** * Setup our test server. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_System_Status_Controller(); $this->user = $this->factory->user->create( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/coupons.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/coupons.php index 3b1aa0e9b36..03a41651159 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/coupons.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/coupons.php @@ -25,7 +25,7 @@ class WC_Tests_API_Coupons extends WC_REST_Unit_Test_Case { * Setup test coupon data. * @since 3.5.0 */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Coupons_Controller(); $this->user = $this->factory->user->create( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/customers.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/customers.php index 43ae89e1229..945128c18b3 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/customers.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/customers.php @@ -17,7 +17,7 @@ class Customers extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Customers_Controller(); } diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/orders.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/orders.php index aa568baf3e8..794c313757f 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/orders.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/orders.php @@ -28,7 +28,7 @@ class WC_Tests_API_Orders extends WC_REST_Unit_Test_Case { /** * Setup our test server. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Orders_Controller(); $this->user = $this->factory->user->create( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/payment-gateways.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/payment-gateways.php index 8d272644a3d..4bddc3f5a0e 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/payment-gateways.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/payment-gateways.php @@ -14,7 +14,7 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Payment_Gateways_Controller(); $this->user = $this->factory->user->create( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/product-reviews.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/product-reviews.php index c277b0e2d7d..11aa94c16b7 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/product-reviews.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/product-reviews.php @@ -11,7 +11,7 @@ class WC_Tests_API_Product_Reviews extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->user = $this->factory->user->create( array( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/product-variations.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/product-variations.php index b0a3e805094..364cea70b95 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/product-variations.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/product-variations.php @@ -14,7 +14,7 @@ class Product_Variations_API extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Product_Variations_Controller(); $this->user = $this->factory->user->create( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/products.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/products.php index 17006c32598..7cc64a56d31 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/products.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/products.php @@ -19,7 +19,7 @@ class WC_Tests_API_Product extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Products_Controller(); $this->user = $this->factory->user->create( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/reports-coupons-totals.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/reports-coupons-totals.php index 162b8af7ef7..a85b0d4c91f 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/reports-coupons-totals.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/reports-coupons-totals.php @@ -11,7 +11,7 @@ class WC_Tests_API_Reports_Coupons_Totals extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->user = $this->factory->user->create( array( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/reports-customers-totals.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/reports-customers-totals.php index cd0e58f886f..4c2f49f815a 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/reports-customers-totals.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/reports-customers-totals.php @@ -11,7 +11,7 @@ class WC_Tests_API_Reports_Customers_Totals extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->user = $this->factory->user->create( array( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/reports-orders-totals.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/reports-orders-totals.php index 93a21a87634..95e1ec02632 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/reports-orders-totals.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/reports-orders-totals.php @@ -11,7 +11,7 @@ class WC_Tests_API_Reports_Orders_Totals extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->user = $this->factory->user->create( array( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/reports-products-totals.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/reports-products-totals.php index 6243786ffad..bba7aef9e29 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/reports-products-totals.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/reports-products-totals.php @@ -11,7 +11,7 @@ class WC_Tests_API_Reports_Products_Totals extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->user = $this->factory->user->create( array( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/reports-reviews-totals.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/reports-reviews-totals.php index 3a2dc1622ff..2c2a915f5e1 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/reports-reviews-totals.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/reports-reviews-totals.php @@ -11,7 +11,7 @@ class WC_Tests_API_Reports_Reviews_Totals extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->user = $this->factory->user->create( array( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/settings.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/settings.php index daf907a7d8a..d82cc9b5ad8 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/settings.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/settings.php @@ -14,7 +14,7 @@ class Settings extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Setting_Options_Controller(); \Automattic\WooCommerce\RestApi\UnitTests\Helpers\SettingsHelper::register(); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/shipping-methods.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/shipping-methods.php index ad139c427af..31dc36c1b14 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/shipping-methods.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/shipping-methods.php @@ -11,7 +11,7 @@ class Shipping_Methods extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Shipping_Methods_Controller(); $this->user = $this->factory->user->create( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/shipping-zones.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/shipping-zones.php index a735357b41f..1dd58034653 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/shipping-zones.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/shipping-zones.php @@ -19,7 +19,7 @@ class WC_Tests_API_Shipping_Zones extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Shipping_Zones_Controller(); $this->user = $this->factory->user->create( diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/system-status.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/system-status.php index 7aa77fbde02..8d8333a5b52 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/system-status.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/system-status.php @@ -36,7 +36,7 @@ class WC_Tests_REST_System_Status extends WC_REST_Unit_Test_Case { /** * Setup our test server. */ - public function setUp() { + public function setUp(): void { parent::setUp(); wp_set_current_user( self::$user ); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/session/class-wc-tests-session-handler.php b/plugins/woocommerce/tests/legacy/unit-tests/session/class-wc-tests-session-handler.php index bb60510722d..c51e3ad8b83 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/session/class-wc-tests-session-handler.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/session/class-wc-tests-session-handler.php @@ -13,7 +13,7 @@ class WC_Tests_Session_Handler extends WC_Unit_Test_Case { /** * Setup. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->handler = new WC_Session_Handler(); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/settings/register-wp-admin-settings.php b/plugins/woocommerce/tests/legacy/unit-tests/settings/register-wp-admin-settings.php index 2d8284e813a..2e29350bfb6 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/settings/register-wp-admin-settings.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/settings/register-wp-admin-settings.php @@ -23,7 +23,7 @@ class WC_Tests_Register_WP_Admin_Settings extends WC_Unit_Test_Case { /** * Initialize a WC_Settings_Page for testing */ - public function setUp() { + public function setUp(): void { parent::setUp(); $mock_page = $this->getMockBuilder( 'WC_Settings_General' )->getMock(); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/shipping/shipping-zone.php b/plugins/woocommerce/tests/legacy/unit-tests/shipping/shipping-zone.php index 99d7dac7c99..da5f7fbdff3 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/shipping/shipping-zone.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/shipping/shipping-zone.php @@ -14,7 +14,7 @@ class WC_Tests_Shipping_Zone extends WC_Unit_Test_Case { /** * Set up tests. */ - public function setUp() { + public function setUp(): void { parent::setUp(); WC_Helper_Shipping_Zones::create_mock_zones(); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/shipping/shipping-zones.php b/plugins/woocommerce/tests/legacy/unit-tests/shipping/shipping-zones.php index 9e1a4d439a3..c08c4d099d9 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/shipping/shipping-zones.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/shipping/shipping-zones.php @@ -14,7 +14,7 @@ class WC_Tests_Shipping_Zones extends WC_Unit_Test_Case { /** * Set up tests. */ - public function setUp() { + public function setUp(): void { parent::setUp(); WC_Helper_Shipping_Zones::create_mock_zones(); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/totals/totals.php b/plugins/woocommerce/tests/legacy/unit-tests/totals/totals.php index 71cca3b3279..59c8295cfc4 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/totals/totals.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/totals/totals.php @@ -27,7 +27,7 @@ class WC_Tests_Totals extends WC_Unit_Test_Case { /** * Setup the cart for totals calculation. */ - public function setUp() { + public function setUp(): void { parent::setUp(); // Set a valid address for the customer so shipping rates will calculate. @@ -115,7 +115,7 @@ class WC_Tests_Totals extends WC_Unit_Test_Case { /** * Clean up after test. */ - public function tearDown() { + public function tearDown(): void { WC()->cart->empty_cart(); WC()->session->set( 'chosen_shipping_methods', array() ); WC_Helper_Shipping::delete_simple_flat_rate(); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/util/api-functions.php b/plugins/woocommerce/tests/legacy/unit-tests/util/api-functions.php index 7a6a64a64bb..a27d961e697 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/util/api-functions.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/util/api-functions.php @@ -29,7 +29,7 @@ class WC_Tests_API_Functions extends WC_Unit_Test_Case { /** * Run setup code for unit tests. */ - public function setUp() { + public function setUp(): void { parent::setUp(); // Callback used by WP_HTTP_TestCase to decide whether to perform HTTP requests or to provide a mocked response. @@ -44,7 +44,7 @@ class WC_Tests_API_Functions extends WC_Unit_Test_Case { /** * Run tear down code for unit tests. */ - public function tearDown() { + public function tearDown(): void { parent::tearDown(); // remove files created in the wc_rest_upload_image_from_url() tests. diff --git a/plugins/woocommerce/tests/legacy/unit-tests/util/class-wc-rate-limiter.php b/plugins/woocommerce/tests/legacy/unit-tests/util/class-wc-rate-limiter.php index 703a475467e..86fbe760083 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/util/class-wc-rate-limiter.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/util/class-wc-rate-limiter.php @@ -15,14 +15,14 @@ class WC_Tests_Rate_Limiter extends WC_Unit_Test_Case { /** * Run setup code for unit tests. */ - public function setUp() { + public function setUp(): void { parent::setUp(); } /** * Run tear down code for unit tests. */ - public function tearDown() { + public function tearDown(): void { parent::tearDown(); } diff --git a/plugins/woocommerce/tests/legacy/unit-tests/util/class-wc-tests-core-functions.php b/plugins/woocommerce/tests/legacy/unit-tests/util/class-wc-tests-core-functions.php index 6f2c17b7d5e..3d5139d4669 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/util/class-wc-tests-core-functions.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/util/class-wc-tests-core-functions.php @@ -18,7 +18,7 @@ class WC_Tests_Core_Functions extends WC_Unit_Test_Case { * * @return void */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->wc = WC(); } diff --git a/plugins/woocommerce/tests/legacy/unit-tests/util/deprecated-hooks.php b/plugins/woocommerce/tests/legacy/unit-tests/util/deprecated-hooks.php index 6d93a50942d..44afd951df1 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/util/deprecated-hooks.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/util/deprecated-hooks.php @@ -51,7 +51,7 @@ class WC_Tests_Deprecated_Hooks extends WC_Unit_Test_Case { /** * Disable deprecation error trigger for this class. */ - public function setUp() { + public function setUp(): void { parent::setUp(); add_filter( 'deprecated_function_trigger_error', '__return_false' ); add_filter( 'deprecated_hook_trigger_error', '__return_false' ); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/util/notice-functions.php b/plugins/woocommerce/tests/legacy/unit-tests/util/notice-functions.php index d150ae16022..31221dd6b3b 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/util/notice-functions.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/util/notice-functions.php @@ -15,7 +15,7 @@ class WC_Tests_Notice_Functions extends WC_Unit_Test_Case { * * @since 2.2 */ - public function tearDown() { + public function tearDown(): void { WC()->session->set( 'wc_notices', null ); } diff --git a/plugins/woocommerce/tests/legacy/unit-tests/util/plugin-updates.php b/plugins/woocommerce/tests/legacy/unit-tests/util/plugin-updates.php index 9d5b12604b5..ff0976b67da 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/util/plugin-updates.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/util/plugin-updates.php @@ -23,7 +23,7 @@ class WC_Tests_Plugin_Updates extends WC_Unit_Test_Case { * * @since 3.2.0 */ - public function setUp() { + public function setUp(): void { parent::setUp(); if ( ! class_exists( 'WC_Plugin_Updates' ) ) { diff --git a/plugins/woocommerce/tests/php/includes/admin/class-wc-admin-dashboard-setup-test.php b/plugins/woocommerce/tests/php/includes/admin/class-wc-admin-dashboard-setup-test.php index 37ec96d3abb..5a271fda33e 100644 --- a/plugins/woocommerce/tests/php/includes/admin/class-wc-admin-dashboard-setup-test.php +++ b/plugins/woocommerce/tests/php/includes/admin/class-wc-admin-dashboard-setup-test.php @@ -15,7 +15,7 @@ class WC_Admin_Dashboard_Setup_Test extends WC_Unit_Test_Case { /** * Set up */ - public function setUp() { + public function setUp(): void { // Set default country to non-US so that 'payments' task gets added but 'woocommerce-payments' doesn't, // by default it won't be considered completed but we can manually change that as needed. update_option( 'woocommerce_default_country', 'JP' ); @@ -36,7 +36,7 @@ class WC_Admin_Dashboard_Setup_Test extends WC_Unit_Test_Case { /** * Tear down */ - public function tearDown() { + public function tearDown(): void { remove_all_filters( 'woocommerce_available_payment_gateways' ); parent::tearDown(); @@ -98,7 +98,7 @@ class WC_Admin_Dashboard_Setup_Test extends WC_Unit_Test_Case { $this->assertFalse( $widget->should_display_widget() ); } - + /** * Tests widget does not display when task list is hidden. */ diff --git a/plugins/woocommerce/tests/php/includes/admin/class-wc-admin-functions-test.php b/plugins/woocommerce/tests/php/includes/admin/class-wc-admin-functions-test.php index 8b0ae6934da..eb194b0cc39 100644 --- a/plugins/woocommerce/tests/php/includes/admin/class-wc-admin-functions-test.php +++ b/plugins/woocommerce/tests/php/includes/admin/class-wc-admin-functions-test.php @@ -13,7 +13,7 @@ class WC_Admin_Functions_Test extends \WC_Unit_Test_Case { /** * Load up the importer classes since they aren't loaded by default. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $bootstrap = \WC_Unit_Tests_Bootstrap::instance(); diff --git a/plugins/woocommerce/tests/php/includes/admin/helper/class-wc-helper-api.php b/plugins/woocommerce/tests/php/includes/admin/helper/class-wc-helper-api.php index 3b30727df22..81904fa4b7f 100644 --- a/plugins/woocommerce/tests/php/includes/admin/helper/class-wc-helper-api.php +++ b/plugins/woocommerce/tests/php/includes/admin/helper/class-wc-helper-api.php @@ -8,7 +8,7 @@ class WC_Tests_Helper_API extends WC_Unit_Test_Case { /** * Set up mock responses for all API calls. */ - public function setUp() { + public function setUp(): void { parent::setUp(); // Callback used by WP_HTTP_TestCase to decide whether to perform HTTP requests or to provide a mocked response. diff --git a/plugins/woocommerce/tests/php/includes/admin/importers/class-wc-product-csv-importer-controller-test.php b/plugins/woocommerce/tests/php/includes/admin/importers/class-wc-product-csv-importer-controller-test.php index e59ef1b1196..b609776d322 100644 --- a/plugins/woocommerce/tests/php/includes/admin/importers/class-wc-product-csv-importer-controller-test.php +++ b/plugins/woocommerce/tests/php/includes/admin/importers/class-wc-product-csv-importer-controller-test.php @@ -10,7 +10,7 @@ class WC_Product_CSV_Importer_Controller_Test extends WC_Unit_Test_Case { /** * Load up the importer classes since they aren't loaded by default. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $bootstrap = WC_Unit_Tests_Bootstrap::instance(); diff --git a/plugins/woocommerce/tests/php/includes/class-wc-cart-test.php b/plugins/woocommerce/tests/php/includes/class-wc-cart-test.php index caf79b5b3b4..84ea12c767b 100644 --- a/plugins/woocommerce/tests/php/includes/class-wc-cart-test.php +++ b/plugins/woocommerce/tests/php/includes/class-wc-cart-test.php @@ -13,7 +13,7 @@ class WC_Cart_Test extends \WC_Unit_Test_Case { /** * tearDown. */ - public function tearDown() { + public function tearDown(): void { parent::tearDown(); WC()->cart->empty_cart(); diff --git a/plugins/woocommerce/tests/php/includes/class-wc-checkout-test.php b/plugins/woocommerce/tests/php/includes/class-wc-checkout-test.php index 5b50a877d83..d05a5b99aa1 100644 --- a/plugins/woocommerce/tests/php/includes/class-wc-checkout-test.php +++ b/plugins/woocommerce/tests/php/includes/class-wc-checkout-test.php @@ -20,7 +20,7 @@ class WC_Checkout_Test extends \WC_Unit_Test_Case { /** * Runs before each test. */ - public function setUp() { + public function setUp(): void { // phpcs:disable Generic.CodeAnalysis, Squiz.Commenting $this->sut = new class() extends WC_Checkout { public function validate_posted_data( &$data, &$errors ) { diff --git a/plugins/woocommerce/tests/php/includes/exporter/class-wc-product-csv-exporter-test.php b/plugins/woocommerce/tests/php/includes/exporter/class-wc-product-csv-exporter-test.php index c2ac4469260..c873cd9cdb2 100644 --- a/plugins/woocommerce/tests/php/includes/exporter/class-wc-product-csv-exporter-test.php +++ b/plugins/woocommerce/tests/php/includes/exporter/class-wc-product-csv-exporter-test.php @@ -20,7 +20,7 @@ class WC_Product_CSV_Exporter_Test extends \WC_Unit_Test_Case { /** * Load up the exporter classes since they aren't loaded by default. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $bootstrap = \WC_Unit_Tests_Bootstrap::instance(); diff --git a/plugins/woocommerce/tests/php/includes/importer/class-wc-product-csv-importer-test.php b/plugins/woocommerce/tests/php/includes/importer/class-wc-product-csv-importer-test.php index d2fbc9d07b3..5a5c8109f34 100644 --- a/plugins/woocommerce/tests/php/includes/importer/class-wc-product-csv-importer-test.php +++ b/plugins/woocommerce/tests/php/includes/importer/class-wc-product-csv-importer-test.php @@ -13,7 +13,7 @@ class WC_Product_CSV_Importer_Test extends \WC_Unit_Test_Case { /** * Load up the importer classes since they aren't loaded by default. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $bootstrap = \WC_Unit_Tests_Bootstrap::instance(); diff --git a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version1/class-wc-rest-product-attributes-v1-controller-tests.php b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version1/class-wc-rest-product-attributes-v1-controller-tests.php index 1d9d178787c..9007ef44bce 100644 --- a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version1/class-wc-rest-product-attributes-v1-controller-tests.php +++ b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version1/class-wc-rest-product-attributes-v1-controller-tests.php @@ -9,7 +9,7 @@ class WC_REST_Product_Attributes_V1_Controller_Tests extends WC_Unit_Test_Case { /** * Runs before any test. */ - public function setUp() { + public function setUp(): void { // phpcs:disable Generic.CodeAnalysis, Squiz.Commenting $this->sut = new class() extends WC_REST_Product_Attributes_V1_Controller { public function get_taxonomy( $request ) { diff --git a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version1/class-wc-rest-product-reviews-v1-controller-tests.php b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version1/class-wc-rest-product-reviews-v1-controller-tests.php index 426f6c3956a..e0dfb3f4bd9 100644 --- a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version1/class-wc-rest-product-reviews-v1-controller-tests.php +++ b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version1/class-wc-rest-product-reviews-v1-controller-tests.php @@ -40,7 +40,7 @@ class WC_REST_Product_Reviews_V1_Controller_Tests extends WC_Unit_Test_Case { /** * Creates test users with varying permissions. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->sut = new WC_REST_Product_Reviews_V1_Controller(); diff --git a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version2/class-wc-rest-orders-v2-controller-test.php b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version2/class-wc-rest-orders-v2-controller-test.php index f9379289e68..d14d88a5f4e 100644 --- a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version2/class-wc-rest-orders-v2-controller-test.php +++ b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version2/class-wc-rest-orders-v2-controller-test.php @@ -9,7 +9,7 @@ class WC_REST_Order_V2_Controller_Test extends WC_REST_Unit_Test_case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Orders_V2_Controller(); $this->user = $this->factory->user->create( diff --git a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version2/class-wc-rest-product-reviews-v2-controller-tests.php b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version2/class-wc-rest-product-reviews-v2-controller-tests.php index 9483a2459a3..592fadf31b3 100644 --- a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version2/class-wc-rest-product-reviews-v2-controller-tests.php +++ b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version2/class-wc-rest-product-reviews-v2-controller-tests.php @@ -19,7 +19,7 @@ class WC_REST_Product_Reviews_V2_Controller_Test extends WC_REST_Unit_Test_case */ private $editor_id; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->sut = new WC_REST_Product_Reviews_V2_Controller(); diff --git a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version2/class-wc-rest-products-controller-tests.php b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version2/class-wc-rest-products-controller-tests.php index 31460f3cc92..ff374aa8b70 100644 --- a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version2/class-wc-rest-products-controller-tests.php +++ b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version2/class-wc-rest-products-controller-tests.php @@ -9,7 +9,7 @@ class WC_REST_Products_V2_Controller_Test extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Products_V2_Controller(); $this->user = $this->factory->user->create( diff --git a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-coupons-controller-tests.php b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-coupons-controller-tests.php index 61e8829e989..e466cecee2c 100644 --- a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-coupons-controller-tests.php +++ b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-coupons-controller-tests.php @@ -9,7 +9,7 @@ class WC_REST_Coupons_Controller_Tests extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Coupons_Controller(); $this->user = $this->factory->user->create( diff --git a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-orders-controller-tests.php b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-orders-controller-tests.php index 2006981dab5..7315bf16247 100644 --- a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-orders-controller-tests.php +++ b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-orders-controller-tests.php @@ -9,7 +9,7 @@ class WC_REST_Orders_Controller_Tests extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Orders_Controller(); $this->user = $this->factory->user->create( diff --git a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-product-reviews-controller-tests.php b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-product-reviews-controller-tests.php index 1303d68c9e9..8d0efb8dcb3 100644 --- a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-product-reviews-controller-tests.php +++ b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-product-reviews-controller-tests.php @@ -33,7 +33,7 @@ class WC_REST_Product_Reviews_Controller_Tests extends WC_REST_Unit_Test_Case { */ private $review_id; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->sut = new WC_REST_Product_Reviews_Controller(); diff --git a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-products-controller-tests.php b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-products-controller-tests.php index 55ac6fc68a0..6f220b9ff7b 100644 --- a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-products-controller-tests.php +++ b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-products-controller-tests.php @@ -9,7 +9,7 @@ class WC_REST_Products_Controller_Tests extends WC_REST_Unit_Test_Case { /** * Setup our test server, endpoints, and user info. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->endpoint = new WC_REST_Products_Controller(); $this->user = $this->factory->user->create( diff --git a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-taxes-controller-tests.php b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-taxes-controller-tests.php index e991716cc93..8b9137e8e8c 100644 --- a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-taxes-controller-tests.php +++ b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-taxes-controller-tests.php @@ -9,7 +9,7 @@ class WC_REST_Taxes_Controller_Tests extends WC_REST_Unit_Test_Case { /** * Runs before any test. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->user = $this->factory->user->create( array( diff --git a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-terms-controller-tests.php b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-terms-controller-tests.php index e7556b02f7d..e9e86eed468 100644 --- a/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-terms-controller-tests.php +++ b/plugins/woocommerce/tests/php/includes/rest-api/Controllers/Version3/class-wc-rest-terms-controller-tests.php @@ -9,7 +9,7 @@ class WC_REST_Terms_Controller_Tests extends WC_Unit_Test_Case { /** * Runs before any test. */ - public function setUp() { + public function setUp(): void { // phpcs:disable Generic.CodeAnalysis, Squiz.Commenting $this->sut = new class() extends WC_REST_Terms_Controller { public function get_taxonomy( $request ) { diff --git a/plugins/woocommerce/tests/php/includes/wc-attribute-functions-test.php b/plugins/woocommerce/tests/php/includes/wc-attribute-functions-test.php index d324ae59581..6eb80155a4a 100644 --- a/plugins/woocommerce/tests/php/includes/wc-attribute-functions-test.php +++ b/plugins/woocommerce/tests/php/includes/wc-attribute-functions-test.php @@ -22,7 +22,7 @@ class WC_Attribute_Functions_Test extends \WC_Unit_Test_Case { /** * Set up. */ - public function setUp() { + public function setUp(): void { parent::setUp(); // Tests will use this to verify the correct call count. @@ -42,7 +42,7 @@ class WC_Attribute_Functions_Test extends \WC_Unit_Test_Case { /** * Tear down. */ - public function tearDown() { + public function tearDown(): void { remove_all_filters( 'woocommerce_attribute_taxonomies' ); remove_all_filters( 'sanitize_taxonomy_name' ); diff --git a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/AbstractServiceProviderTest.php b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/AbstractServiceProviderTest.php index beaa70dcef8..c3b82091515 100644 --- a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/AbstractServiceProviderTest.php +++ b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/AbstractServiceProviderTest.php @@ -39,7 +39,7 @@ class AbstractServiceProviderTest extends \WC_Unit_Test_Case { /** * Runs before each test. */ - public function setUp() { + public function setUp(): void { $this->container = new ExtendedContainer(); $this->sut = new class() extends AbstractServiceProvider { @@ -67,7 +67,7 @@ class AbstractServiceProviderTest extends \WC_Unit_Test_Case { /** * Runs before all the tests of the class. */ - public static function setUpBeforeClass() { + public static function setUpBeforeClass(): void { /** * Return a new instance of ClassWithDependencies. * diff --git a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExtendedContainerTest.php b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExtendedContainerTest.php index 679c45913e9..2fb4f391931 100644 --- a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExtendedContainerTest.php +++ b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExtendedContainerTest.php @@ -25,7 +25,7 @@ class ExtendedContainerTest extends \WC_Unit_Test_Case { /** * Runs before each test. */ - public function setUp() { + public function setUp(): void { $this->sut = new ExtendedContainer(); } diff --git a/plugins/woocommerce/tests/php/src/Internal/DownloadPermissionsAdjusterTest.php b/plugins/woocommerce/tests/php/src/Internal/DownloadPermissionsAdjusterTest.php index 3df747de564..7f31dd09a3a 100644 --- a/plugins/woocommerce/tests/php/src/Internal/DownloadPermissionsAdjusterTest.php +++ b/plugins/woocommerce/tests/php/src/Internal/DownloadPermissionsAdjusterTest.php @@ -24,7 +24,7 @@ class DownloadPermissionsAdjusterTest extends \WC_Unit_Test_Case { /** * Runs before each test. */ - public function setUp() { + public function setUp(): void { $this->sut = new DownloadPermissionsAdjuster(); $this->sut->init(); diff --git a/plugins/woocommerce/tests/php/src/Internal/ProductAttributesLookup/DataRegeneratorTest.php b/plugins/woocommerce/tests/php/src/Internal/ProductAttributesLookup/DataRegeneratorTest.php index 57fe756ec88..68cfd081af6 100644 --- a/plugins/woocommerce/tests/php/src/Internal/ProductAttributesLookup/DataRegeneratorTest.php +++ b/plugins/woocommerce/tests/php/src/Internal/ProductAttributesLookup/DataRegeneratorTest.php @@ -40,7 +40,7 @@ class DataRegeneratorTest extends \WC_Unit_Test_Case { /** * Runs before each test. */ - public function setUp() { + public function setUp(): void { global $wpdb; parent::setUp(); diff --git a/plugins/woocommerce/tests/php/src/Internal/ProductAttributesLookup/FiltererTest.php b/plugins/woocommerce/tests/php/src/Internal/ProductAttributesLookup/FiltererTest.php index 655b0afe4bd..0a9851392fc 100644 --- a/plugins/woocommerce/tests/php/src/Internal/ProductAttributesLookup/FiltererTest.php +++ b/plugins/woocommerce/tests/php/src/Internal/ProductAttributesLookup/FiltererTest.php @@ -14,7 +14,7 @@ class FiltererTest extends \WC_Unit_Test_Case { /** * Runs before all the tests in the class. */ - public static function setupBeforeClass() { + public static function setUpBeforeClass(): void { global $wpdb, $wp_post_types; parent::setUpBeforeClass(); @@ -41,7 +41,7 @@ class FiltererTest extends \WC_Unit_Test_Case { /** * Runs after each test. */ - public function tearDown() { + public function tearDown(): void { global $wpdb; parent::tearDown(); diff --git a/plugins/woocommerce/tests/php/src/Internal/ProductAttributesLookup/LookupDataStoreTest.php b/plugins/woocommerce/tests/php/src/Internal/ProductAttributesLookup/LookupDataStoreTest.php index 3b124f31645..81d15c11eef 100644 --- a/plugins/woocommerce/tests/php/src/Internal/ProductAttributesLookup/LookupDataStoreTest.php +++ b/plugins/woocommerce/tests/php/src/Internal/ProductAttributesLookup/LookupDataStoreTest.php @@ -33,14 +33,14 @@ class LookupDataStoreTest extends \WC_Unit_Test_Case { /** * Runs after all the tests in the class. */ - public static function tearDownAfterClass() { + public static function tearDownAfterClass(): void { parent::tearDownAfterClass(); } /** * Runs before each test. */ - public function setUp() { + public function setUp(): void { global $wpdb; $this->lookup_table_name = $wpdb->prefix . 'wc_product_attributes_lookup'; diff --git a/plugins/woocommerce/tests/php/src/Internal/ProductDownloads/ApprovedDirectories/RegisterTest.php b/plugins/woocommerce/tests/php/src/Internal/ProductDownloads/ApprovedDirectories/RegisterTest.php index f5780121a2c..de027258f2c 100644 --- a/plugins/woocommerce/tests/php/src/Internal/ProductDownloads/ApprovedDirectories/RegisterTest.php +++ b/plugins/woocommerce/tests/php/src/Internal/ProductDownloads/ApprovedDirectories/RegisterTest.php @@ -19,7 +19,7 @@ class RegisterTest extends WC_Unit_Test_Case { * Create a Whitelist with representative paths including a URL with a port number, * a regular URL and an absolute filepath. */ - public static function setUpBeforeClass() { + public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); static::$sut = new Register(); diff --git a/plugins/woocommerce/tests/php/src/Internal/ProductDownloads/ApprovedDirectories/SynchronizeTest.php b/plugins/woocommerce/tests/php/src/Internal/ProductDownloads/ApprovedDirectories/SynchronizeTest.php index 047940654c9..5ffb93d3ddd 100644 --- a/plugins/woocommerce/tests/php/src/Internal/ProductDownloads/ApprovedDirectories/SynchronizeTest.php +++ b/plugins/woocommerce/tests/php/src/Internal/ProductDownloads/ApprovedDirectories/SynchronizeTest.php @@ -22,7 +22,7 @@ class SynchronizeTest extends WC_Unit_Test_Case { /** * Create subject under test. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->sut = wc_get_container()->get( Synchronize::class ); } diff --git a/plugins/woocommerce/tests/php/src/Proxies/ClassThatDependsOnLegacyCodeTest.php b/plugins/woocommerce/tests/php/src/Proxies/ClassThatDependsOnLegacyCodeTest.php index 2f1985c095d..71dc225cab3 100644 --- a/plugins/woocommerce/tests/php/src/Proxies/ClassThatDependsOnLegacyCodeTest.php +++ b/plugins/woocommerce/tests/php/src/Proxies/ClassThatDependsOnLegacyCodeTest.php @@ -23,7 +23,7 @@ class ClassThatDependsOnLegacyCodeTest extends \WC_Unit_Test_Case { /** * Runs before each test. */ - public function setUp() { + public function setUp(): void { $container = wc_get_container(); $container->add( ClassThatDependsOnLegacyCode::class )->addArgument( LegacyProxy::class ); $this->sut = $container->get( ClassThatDependsOnLegacyCode::class ); diff --git a/plugins/woocommerce/tests/php/src/Proxies/LegacyProxyTest.php b/plugins/woocommerce/tests/php/src/Proxies/LegacyProxyTest.php index 9d616368665..240c0c4de02 100644 --- a/plugins/woocommerce/tests/php/src/Proxies/LegacyProxyTest.php +++ b/plugins/woocommerce/tests/php/src/Proxies/LegacyProxyTest.php @@ -23,7 +23,7 @@ class LegacyProxyTest extends \WC_Unit_Test_Case { /** * Runs before each test. */ - public function setUp() { + public function setUp(): void { $this->sut = new LegacyProxy(); } diff --git a/plugins/woocommerce/tests/php/src/Proxies/MockableLegacyProxyTest.php b/plugins/woocommerce/tests/php/src/Proxies/MockableLegacyProxyTest.php index 579f514a7bc..e69d24582c2 100644 --- a/plugins/woocommerce/tests/php/src/Proxies/MockableLegacyProxyTest.php +++ b/plugins/woocommerce/tests/php/src/Proxies/MockableLegacyProxyTest.php @@ -23,7 +23,7 @@ class MockableLegacyProxyTest extends \WC_Unit_Test_Case { /** * Runs before each test. */ - public function setUp() { + public function setUp(): void { $this->sut = new MockableLegacyProxy(); }