Skip to content

Commit

Permalink
Document changes in cakephp/cakephp#17856
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Aug 22, 2024
1 parent bd0d2c8 commit 504af6a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions en/appendices/5-1-migration-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ TestSuite
its methods were updated to be static.
- ``LogTestTrait`` was added. This new trait makes it easy to capture logs in
your tests and make assertions on the presence or absence of log messages.
- ``IntegrationTestTrait::replaceRequest()`` was added.

Utility
-------
Expand Down
11 changes: 10 additions & 1 deletion en/development/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1098,13 +1098,22 @@ to configure the requests you will send to your application under test::
// Set session data
$this->session(['Auth.User.id' => 1]);

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

// Replace the existing request. Added in 5.1.0
$this->replaceRequest([
'headers' => ['Accept' => 'application/json']
]);


The state set by these helper methods is reset in the ``tearDown()`` method.

.. versionadded:: 5.1.0
``replaceRequest()`` was added.

Testing Actions Protected by CsrfComponent or SecurityComponent
---------------------------------------------------------------

Expand Down

0 comments on commit 504af6a

Please sign in to comment.