To fully test a function that uses globals, we need to suppress the global override warning.
This commit is contained in:
parent
764f8d4490
commit
403210185c
|
@ -165,6 +165,7 @@ class WC_Tests_Order_Functions extends WC_Unit_Test_Case {
|
|||
global $post;
|
||||
global $theorder;
|
||||
|
||||
// phpcs:disable WordPress.WP.GlobalVariablesOverride.Prohibited
|
||||
$original_post = $post;
|
||||
$original_theorder = $theorder;
|
||||
|
||||
|
@ -206,6 +207,7 @@ class WC_Tests_Order_Functions extends WC_Unit_Test_Case {
|
|||
|
||||
$post = $original_post;
|
||||
$theorder = $original_theorder;
|
||||
// phpcs:enable WordPress.WP.GlobalVariablesOverride.Prohibited
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue