From ddf7fad82fb5543f68cd8fcfcef0f369d8e4fd6d Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Thu, 20 Nov 2025 21:48:53 +0100 Subject: [PATCH] Set content type/length for module test requests Just use default values of 'text/html' and 0 for now. Should probably be set to more realistic values at some point, but for now it seems to work. This fixes warnings in the OwaTest. --- tests/unit/Module/TestCase.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/unit/Module/TestCase.php b/tests/unit/Module/TestCase.php index dd88a5a3b..1f9c03cb2 100644 --- a/tests/unit/Module/TestCase.php +++ b/tests/unit/Module/TestCase.php @@ -44,6 +44,8 @@ class TestCase extends UnitTestCase { $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1'; $_SERVER['QUERY_STRING'] = "q={$uri}"; $_SERVER['REQUEST_URI'] = $uri; + $_SERVER['CONTENT_TYPE'] = 'text/html'; + $_SERVER['CONTENT_LENGTH'] = 0; // phpcs:disable Generic.PHP.DisallowRequestSuperglobal.Found $_REQUEST = array_merge($_GET, $_POST);