woocommerce/tests/php/includes
Nestor Soriano 00d6dc40f7 Fix wrong caching of taxonomy in terms and attributes controllers.
The WC_REST_Terms_Controller and WC_REST_Product_Attributes_V1_Controller
classes have a get_taxonomy method that gets the name of the taxonomy
to process from a taxonomy id passed in the request, but once the
taxonomy name has been obtained it's cached and sbsequently reused.
The problem is that these controller instances are reused if more than
one request is processed programmatically, and thus the taxonomy that
was cached once is always used even if the new request specifies a
different taxonomy id.

The fix consists of using a dictionary of taxonomy id - taxonomy name
instead of one single taxonomy for caching.

In the case of WC_REST_Terms_Controller there's a protected $taxonomy
property that needs to be kept for compatibility, it's now set to
the last taxonomy name that has been introduced in the dictionary.
2021-02-12 15:12:58 +01:00
..
abstracts Add unit test 2020-11-12 22:58:05 +05:30
admin Add unit tests for the fix 2020-11-11 15:28:06 -06:00
data-stores Add a new WC_Shipping_Zone_Data_Store_CPT_Test class to support the refactoring of WC_Shipping_Zone_Data_Store_CPT::read() 2021-01-12 18:26:00 +00:00
exporter Added unit tests for importer and exporter 2020-07-15 21:49:26 -03:00
gateways/paypal Add unit tests for when PayPal API will return error 2020-09-18 17:12:33 +05:30
importer Added unit tests for importer and exporter 2020-07-15 21:49:26 -03:00
rest-api/Controllers Fix wrong caching of taxonomy in terms and attributes controllers. 2021-02-12 15:12:58 +01:00
class-wc-ajax-test.php Add unit tests. 2020-09-25 19:41:20 +05:30
class-wc-cart-test.php Add unit test for #27756 2020-10-26 12:32:15 -07:00
class-wc-checkout-test.php validate_posted_data: check if we actually need to validate the shipping country. 2021-02-10 10:05:24 +01:00
class-wc-comments-test.php Add unit tests for review count methods. 2021-01-14 18:31:02 +05:30
class-wc-customer-test.php Add tests for #28692 2020-12-30 19:29:22 +05:30
class-wc-discounts-tests.php Add unit tests for #28592 2020-12-16 19:37:01 +05:30
class-wc-emails-tests.php Fix typos. 2021-01-18 19:52:20 +05:30
class-wc-install-test.php Added some exceptions to the PHPCS standards for unit tests 2020-07-15 14:29:13 -07:00
class-wc-post-data-test.php Added unit tests for coupon code sanitization 2020-07-27 17:44:04 -03:00
class-wc-product-variable-test.php Fixed test that used PHPUnit function from newer version 2020-08-05 15:43:08 -07:00
class-wc-query-test.php Fix price filtering when there are variations. 2021-02-05 16:34:42 +01:00
wc-core-functions-test.php Use reference in wc_asort_by_locale 2020-09-10 16:02:39 -03:00
wc-formatting-functions-test.php Added unit tests for coupon code sanitization 2020-07-27 17:44:04 -03:00
wc-stock-functions-tests.php Fixed coding standards 2020-12-21 12:46:01 -03:00