To fully test a function that uses globals, we need to suppress the global override warning.

This commit is contained in:
barryhughes 2023-01-18 10:29:55 -08:00
parent 764f8d4490
commit 403210185c
1 changed files with 2 additions and 0 deletions

View File

@ -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
}
/**