File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -236,6 +236,9 @@ public function set_up() {
236
236
->getMock ();
237
237
238
238
$ this ->init_gateways ();
239
+
240
+ // Replace the main class's gateway for testing purposes.
241
+ $ this ->_gateway = WC_Payments::get_gateway ();
239
242
WC_Payments::set_gateway ( $ this ->card_gateway );
240
243
241
244
$ this ->woopay_utilities = new WooPay_Utilities ();
@@ -266,6 +269,9 @@ public function tear_down() {
266
269
// Restore the cache service in the main class.
267
270
WC_Payments::set_database_cache ( $ this ->_cache );
268
271
272
+ // Restore the gateway in the main class.
273
+ WC_Payments::set_gateway ( $ this ->_gateway );
274
+
269
275
// Fall back to an US store.
270
276
update_option ( 'woocommerce_store_postcode ' , '94110 ' );
271
277
$ this ->card_gateway ->update_option ( 'saved_cards ' , 'yes ' );
You can’t perform that action at this time.
0 commit comments