File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 55use Codeception \TestCase \WPTestCase ;
66
77class WCTestCase extends WPTestCase {
8+ private $ original_cart ;
9+ private $ original_session ;
10+ private $ original_customer ;
11+ private $ original_query ;
12+
813 /**
914 * @return WC_UnitTest_Factory
1015 */
@@ -15,4 +20,22 @@ protected static function factory() {
1520 }
1621 return $ factory ;
1722 }
23+
24+ public function _setUp ()
25+ {
26+ parent ::_setUp ();
27+ $ this ->original_cart = WC ()->cart ;
28+ $ this ->original_session = WC ()->session ;
29+ $ this ->original_customer = WC ()->customer ;
30+ $ this ->original_query = WC ()->query ;
31+ }
32+
33+ public function _tearDown ()
34+ {
35+ parent ::_tearDown ();
36+ WC ()->cart = $ this ->original_cart ;
37+ WC ()->session = $ this ->original_session ;
38+ WC ()->customer = $ this ->original_customer ;
39+ WC ()->query = $ this ->original_query ;
40+ }
1841}
You can’t perform that action at this time.
0 commit comments