Skip to content

Commit 24f8777

Browse files
committed
Tests: Add phpcs:ignore for global reset in tearDown methods
1 parent 32cfec9 commit 24f8777

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

tests/php/includes/forms/test-form-comment.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ public function tearDown(): void {
2323

2424
// Reset globals to prevent polluting other tests.
2525
global $pagenow, $post;
26+
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- Resetting globals in test tearDown.
2627
$pagenow = null;
27-
$post = null;
28+
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- Resetting globals in test tearDown.
29+
$post = null;
2830
}
2931

3032
/**

tests/php/includes/forms/test-form-gutenberg.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public function tearDown(): void {
2323

2424
// Reset global $current_screen to prevent polluting other tests.
2525
global $current_screen;
26+
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- Resetting globals in test tearDown.
2627
$current_screen = null;
2728
}
2829

tests/php/includes/forms/test-form-taxonomy.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public function tearDown(): void {
2323

2424
// Reset globals to prevent polluting other tests.
2525
global $pagenow;
26+
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- Resetting globals in test tearDown.
2627
$pagenow = null;
2728
}
2829

0 commit comments

Comments
 (0)