diff --git a/tests/integration/TestAjaxHandler.php b/tests/integration/TestAjaxHandler.php
index f930d5c566eb79c8e01eddf68fe381b70631cc53..2b0c605223eaaf205b8817cfeea61aec012992d0 100644
--- a/tests/integration/TestAjaxHandler.php
+++ b/tests/integration/TestAjaxHandler.php
@@ -42,6 +42,10 @@ class TestAjaxHandler extends WP_UnitTestCase
 
     public function testEnqueueAdminScripts()
     {
+        $screen = get_current_screen();
+        if ( !isset( $screen->id ) ) {
+            $screen->id = 'test';
+        }
         $ajaxHandler = new AjaxHandler(self::ASSETS_URL);
         $ajaxHandler->hooks();
         do_action('admin_enqueue_scripts');