From 1860cd1933d6ef49a7ffbf0c42307fd682b4ce5a Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Thu, 19 Jul 2018 14:17:06 -0300 Subject: [PATCH] Change WC_Unit_Test_Case to extend WP_HTTP_TestCase instead of WP_UnitTestCase This commits changes WC_Unit_Test_Case parent class to WP_HTTP_TestCase (which extends WP_UnitTestCase). This way all WC core test classes can benefit from the functionality provided by WP_HTTP_TestCase if needed. This is necessary because otherwise test classes can use the functionality provided by WC_Unit_Test_Case or WP_HTTP_TestCase. This change should not affect test classes that don't explicitly call one of the WP_HTTP_TestCase features. --- tests/bootstrap.php | 2 +- tests/framework/class-wc-unit-test-case.php | 2 +- tests/unit-tests/formatting/functions.php | 2 +- tests/unit-tests/importer/product.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index b1d5cb8791c..69cc24d702e 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -110,10 +110,10 @@ class WC_Unit_Tests_Bootstrap { require_once $this->tests_dir . '/framework/vendor/class-wp-test-spy-rest-server.php'; // 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'; - require_once $this->tests_dir . '/includes/wp-http-testcase.php'; // Helpers require_once $this->tests_dir . '/framework/helpers/class-wc-helper-product.php'; diff --git a/tests/framework/class-wc-unit-test-case.php b/tests/framework/class-wc-unit-test-case.php index 06f62ee6d44..30d6b2c2dcf 100644 --- a/tests/framework/class-wc-unit-test-case.php +++ b/tests/framework/class-wc-unit-test-case.php @@ -13,7 +13,7 @@ * * @since 2.2 */ -class WC_Unit_Test_Case extends WP_UnitTestCase { +class WC_Unit_Test_Case extends WP_HTTP_TestCase { /** * Holds the WC_Unit_Test_Factory instance. diff --git a/tests/unit-tests/formatting/functions.php b/tests/unit-tests/formatting/functions.php index 608d30ab7b6..049fb1b721d 100644 --- a/tests/unit-tests/formatting/functions.php +++ b/tests/unit-tests/formatting/functions.php @@ -10,7 +10,7 @@ * * @since 2.2 */ -class WC_Tests_Formatting_Functions extends WP_HTTP_TestCase { +class WC_Tests_Formatting_Functions extends WC_Unit_Test_Case { public function setUp() { parent::setUp(); diff --git a/tests/unit-tests/importer/product.php b/tests/unit-tests/importer/product.php index 0dec3beb69b..42984e1086e 100644 --- a/tests/unit-tests/importer/product.php +++ b/tests/unit-tests/importer/product.php @@ -4,7 +4,7 @@ * Meta * @package WooCommerce\Tests\Importer */ -class WC_Tests_Product_CSV_Importer extends WP_HTTP_TestCase { +class WC_Tests_Product_CSV_Importer extends WC_Unit_Test_Case { /** * Test CSV file path.