Skip to content

Commit 76db440

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: Added more details to the explanation Every custom header in testing client must have HTTP prefix
2 parents a3b14a2 + d564173 commit 76db440

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

testing.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,13 @@ You can also override HTTP headers on a per request basis::
10711071
'HTTP_USER_AGENT' => 'MySuperBrowser/1.0',
10721072
]);
10731073

1074+
.. caution::
1075+
1076+
The name of your custom headers must follow the syntax defined in the
1077+
`section 4.1.18 of RFC 3875`_: replace ``-`` by ``_``, transform it into
1078+
uppercase and prefix the result with ``HTTP_``. For example, if your
1079+
header name is ``X-Session-Token``, pass ``HTTP_X_SESSION_TOKEN``.
1080+
10741081
.. tip::
10751082

10761083
The test client is available as a service in the container in the ``test``
@@ -1166,3 +1173,4 @@ Learn more
11661173
.. _`$_SERVER`: https://www.php.net/manual/en/reserved.variables.server.php
11671174
.. _`data providers`: https://phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.data-providers
11681175
.. _`code coverage analysis`: https://phpunit.readthedocs.io/en/9.1/code-coverage-analysis.html
1176+
.. _`section 4.1.18 of RFC 3875`: https://tools.ietf.org/html/rfc3875#section-4.1.18

0 commit comments

Comments
 (0)