woocommerce/tests/php/includes/rest-api/Controllers/Version3
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
..
class-wc-rest-create-product-with-tags-controller-test.php Add unit tests 2021-01-05 08:14:39 -08:00
class-wc-rest-order-refunds-controller-test.php Add shipping, tax and fee lines to refund response for better information. 2020-11-11 18:47:48 +05:30
class-wc-rest-orders-controller-tests.php Add tests for checking all fields are returned even requested individually. 2021-01-06 15:12:55 +05:30
class-wc-rest-products-controller-tests.php More for individual fields in responses for V2 and V3 products and orders endpoints. 2021-01-06 16:04:56 +05:30
class-wc-rest-terms-controller-tests.php Fix wrong caching of taxonomy in terms and attributes controllers. 2021-02-12 15:12:58 +01:00