Skip to content

Commit

Permalink
Fix CF7 tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
kagg-design committed Jul 9, 2024
1 parent 3bca9a5 commit 49148de
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .tests/php/integration/CF7/AdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class AdminTest extends HCaptchaPluginWPTestCase {
* Tear down the test.
*/
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
unset( $GLOBALS['current_screen'] );
unset( $GLOBALS['current_screen'], $_GET['post'] );

parent::tearDown();
}
Expand Down Expand Up @@ -71,6 +71,12 @@ public function test_init_hooks( bool $mode_auto, bool $mode_embed, bool $is_adm

$subject = new Admin();

if ( $is_admin && $cf7_status ) {
$_GET['post'] = 177;

set_current_screen( 'toplevel_page_wpcf7' );
}

if ( $expected ) {
self::assertSame(
54,
Expand Down

0 comments on commit 49148de

Please sign in to comment.