Skip to content

Commit 3c43081

Browse files
committed
docs: add changelog, upgrade guide, and missing explanation for $params
1 parent 5fe0572 commit 3c43081

3 files changed

Lines changed: 33 additions & 1 deletion

File tree

user_guide_src/source/changelogs/v4.3.7.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ Release Date: Unreleased
1212
BREAKING
1313
********
1414

15+
- **FeatureTestTrait:** When using :ref:`withBodyFormat() <feature-formatting-the-request>`,
16+
the priority of the request body has been changed.
17+
See :ref:`Upgrading Guide <upgrade-437-feature-testing>` for details.
18+
1519
Message Changes
1620
***************
1721

user_guide_src/source/installation/upgrade_437.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,27 @@ Mandatory File Changes
1818
Breaking Changes
1919
****************
2020

21+
.. _upgrade-437-feature-testing:
22+
23+
Feature Testing Request Body
24+
============================
25+
26+
If you call:
27+
28+
1. :ref:`withBody() <feature-setting-the-body>`
29+
2. and :ref:`withBodyFormat() <feature-formatting-the-request>`
30+
3. and pass the ``$params`` to :ref:`call() <feature-requesting-a-page>` (or shorthand methods)
31+
32+
the priority for a Request body has been changed. In the unlikely event that you
33+
have test code affected by this change, modify it.
34+
35+
For example, now the ``$params`` is used to build the request body, and the ``$body``
36+
is not used::
37+
38+
$this->withBody($body)->withBodyFormat('json')->call('post', $params)
39+
40+
Previously, the ``$body`` was used for the request body.
41+
2142
Breaking Enhancements
2243
*********************
2344

user_guide_src/source/testing/feature.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ are called if you implement your own methods.
2121

2222
.. literalinclude:: feature/001.php
2323

24+
.. _feature-requesting-a-page:
25+
2426
Requesting a Page
2527
=================
2628

@@ -32,7 +34,8 @@ To do this, you use the ``call()`` method.
3234
3. The third parameter ``$params`` accepts an array that is used to populate the
3335
superglobal variables for the HTTP verb you are using. So, a method of **GET**
3436
would have the **$_GET** variable populated, while a **POST** request would
35-
have the **$_POST** array populated.
37+
have the **$_POST** array populated. The ``$params`` is also used in
38+
:ref:`feature-formatting-the-request`.
3639

3740
.. note:: The ``$params`` array does not make sense for every HTTP verb, but is
3841
included for consistency.
@@ -82,6 +85,8 @@ to send out emails. You can tell the system to skip any event handling with the
8285

8386
.. literalinclude:: feature/007.php
8487

88+
.. _feature-formatting-the-request:
89+
8590
Formatting the Request
8691
-----------------------
8792

@@ -96,6 +101,8 @@ This will also set the `Content-Type` header for your request accordingly.
96101

97102
.. literalinclude:: feature/008.php
98103

104+
.. _feature-setting-the-body:
105+
99106
Setting the Body
100107
----------------
101108

0 commit comments

Comments
 (0)