Skip to content

Commit 504af6a

Browse files
committed
Document changes in cakephp/cakephp#17856
1 parent bd0d2c8 commit 504af6a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

en/appendices/5-1-migration-guide.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ TestSuite
138138
its methods were updated to be static.
139139
- ``LogTestTrait`` was added. This new trait makes it easy to capture logs in
140140
your tests and make assertions on the presence or absence of log messages.
141+
- ``IntegrationTestTrait::replaceRequest()`` was added.
141142

142143
Utility
143144
-------

en/development/testing.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,13 +1098,22 @@ to configure the requests you will send to your application under test::
10981098
// Set session data
10991099
$this->session(['Auth.User.id' => 1]);
11001100

1101-
// Configure headers
1101+
// Configure headers and merge with the existing request
11021102
$this->configRequest([
11031103
'headers' => ['Accept' => 'application/json']
11041104
]);
11051105

1106+
// Replace the existing request. Added in 5.1.0
1107+
$this->replaceRequest([
1108+
'headers' => ['Accept' => 'application/json']
1109+
]);
1110+
1111+
11061112
The state set by these helper methods is reset in the ``tearDown()`` method.
11071113

1114+
.. versionadded:: 5.1.0
1115+
``replaceRequest()`` was added.
1116+
11081117
Testing Actions Protected by CsrfComponent or SecurityComponent
11091118
---------------------------------------------------------------
11101119

0 commit comments

Comments
 (0)