Skip to content

Commit

Permalink
Merge branch '5.2' into 5.x
Browse files Browse the repository at this point in the history
* 5.2:
  Added more details to the explanation
  Every custom header in testing client must have HTTP prefix
  • Loading branch information
javiereguiluz committed Apr 6, 2021
2 parents a3b14a2 + d564173 commit 76db440
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,13 @@ You can also override HTTP headers on a per request basis::
'HTTP_USER_AGENT' => 'MySuperBrowser/1.0',
]);

.. caution::

The name of your custom headers must follow the syntax defined in the
`section 4.1.18 of RFC 3875`_: replace ``-`` by ``_``, transform it into
uppercase and prefix the result with ``HTTP_``. For example, if your
header name is ``X-Session-Token``, pass ``HTTP_X_SESSION_TOKEN``.

.. tip::

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

0 comments on commit 76db440

Please sign in to comment.