Skip to content

Commit b232241

Browse files
committed
Remove the deprecated SetUpTearDownTrait feature
1 parent 37539a4 commit b232241

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

components/phpunit_bridge.rst

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -458,36 +458,6 @@ PHPUnit to remove the return type (introduced in PHPUnit 8) from ``setUp()``,
458458
``tearDown()``, ``setUpBeforeClass()`` and ``tearDownAfterClass()`` methods.
459459
This allows you to write a test compatible with both PHP 5 and PHPUnit 8.
460460

461-
Alternatively, you can use the trait :class:`Symfony\\Bridge\\PhpUnit\\SetUpTearDownTrait`,
462-
which provides the right signature for the ``setUp()``, ``tearDown()``,
463-
``setUpBeforeClass()`` and ``tearDownAfterClass()`` methods and delegates the
464-
call to the ``doSetUp()``, ``doTearDown()``, ``doSetUpBeforeClass()`` and
465-
``doTearDownAfterClass()`` methods::
466-
467-
use PHPUnit\Framework\TestCase;
468-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
469-
470-
class MyTest extends TestCase
471-
{
472-
// when using the SetUpTearDownTrait, methods like doSetUp() can
473-
// be defined with and without the 'void' return type, as you wish
474-
use SetUpTearDownTrait;
475-
476-
private function doSetUp()
477-
{
478-
// ...
479-
}
480-
481-
protected function doSetUp(): void
482-
{
483-
// ...
484-
}
485-
}
486-
487-
.. deprecated:: 5.3
488-
489-
The ``SetUpTearDownTrait`` was deprecated in Symfony 5.3.
490-
491461
Using Namespaced PHPUnit Classes
492462
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
493463

0 commit comments

Comments
 (0)