Commit Graph

4 Commits

Author SHA1 Message Date
Vedanshu Jain 6d8aa16d4c Add protection around mock queries in unit tests. (https://github.com/woocommerce/woocommerce-blocks/pull/3602)
* Add protection around mock queries in unit tests.

This adds additional checks before mocking wc_get_orders query results to prevent overriding refunds query. This is needed with WC core 4.9 since it does an addtional wc_get_orders query to preload and hydrate cache for refunds in order to improve performance.

* update jetpack autoloader to 2.7.1

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2021-01-14 15:48:57 +01:00
Albert Juhé Lluveras 6753023e08 Move feature flag PHP logic to a service class (https://github.com/woocommerce/woocommerce-blocks/pull/3343)
* Move feature flag PHP logic to a service class

* Add legacy methods

* Inject a FeatureGating class instance into Package

* Make is_experimental_build and is_feature_plugin_build methods non static
2020-11-17 08:46:12 +01:00
Darren Ethier dcdc5c48ce Improve behaviour of draft order cleanup to account for clobbered custom shop order status. (https://github.com/woocommerce/woocommerce-blocks/pull/2912)
* improve behaviour of draft order cleanup with tests

* hide error logging output from tests

* fix doc

* fix status check and test setup/teardown
2020-08-07 15:36:55 -04:00
Darren Ethier 60b1422cf6 Move Draft order logic behind feature flag. (https://github.com/woocommerce/woocommerce-blocks/pull/2874)
* refactor all draft order functionality to be in it’s own class and feature gate it.

* move and fix tests for draft order deletes

* add test to ensure only draft orders are deleted

* implement review feedback and assert valid results before deleting

* update tests

* doh method can’t be protected

* fix conditional for removing scheduled action

* switch to use Woo Core function for catching the exception

* add tests for error handling.

* use `$wpdb->prepare` and remove temp group on test
2020-07-16 12:19:31 -04:00