Skip to content

Commit

Permalink
Update references to defunct classes
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad authored Nov 5, 2024
1 parent ffd9381 commit f5c54e2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 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 CsrfMiddleware 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 f5c54e2

Please sign in to comment.