Skip to content

Commit

Permalink
Merge pull request #7948 from cakephp/ADmad-patch-2
Browse files Browse the repository at this point in the history
Update references to defunct classes
  • Loading branch information
markstory authored Nov 5, 2024
2 parents a385e8a + 8a0c0d9 commit f373219
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions en/development/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -987,8 +987,6 @@ controller code looks like::

class ArticlesController extends AppController
{
public $helpers = ['Form', 'Html'];

public function index($short = null)
{
if ($this->request->is('post')) {
Expand Down Expand Up @@ -1114,10 +1112,10 @@ 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
---------------------------------------------------------------
Testing Actions Protected by CsrfProtectionMiddleware or FormProtectionComponent
--------------------------------------------------------------------------------

When testing actions protected by either SecurityComponent or CsrfComponent you
When testing actions protected by either ``CsrfProtectionMiddleware`` or ``FormProtectionComponent`` you
can enable automatic token generation to ensure your tests won't fail due to
token mismatches::

Expand All @@ -1129,7 +1127,7 @@ token mismatches::
}

It is also important to enable debug in tests that use tokens to prevent the
SecurityComponent from thinking the debug token is being used in a non-debug
``FormProtectionComponent`` from thinking the debug token is being used in a non-debug
environment. When testing with other methods like ``requireSecure()`` you
can use ``configRequest()`` to set the correct environment variables::

Expand Down

0 comments on commit f373219

Please sign in to comment.