Skip to content

Commit ace2802

Browse files
committed
Merge branch '6.1' into 6.2
* 6.1: Remove the deprecated SetUpTearDownTrait feature [PhpUnitBridge] Mention the SetUpTearDownTrait deprecation
2 parents f444462 + e93ef7e commit ace2802

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

components/phpunit_bridge.rst

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

490-
Alternatively, you can use the trait :class:`Symfony\\Bridge\\PhpUnit\\SetUpTearDownTrait`,
491-
which provides the right signature for the ``setUp()``, ``tearDown()``,
492-
``setUpBeforeClass()`` and ``tearDownAfterClass()`` methods and delegates the
493-
call to the ``doSetUp()``, ``doTearDown()``, ``doSetUpBeforeClass()`` and
494-
``doTearDownAfterClass()`` methods::
495-
496-
use PHPUnit\Framework\TestCase;
497-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
498-
499-
class MyTest extends TestCase
500-
{
501-
// when using the SetUpTearDownTrait, methods like doSetUp() can
502-
// be defined with and without the 'void' return type, as you wish
503-
use SetUpTearDownTrait;
504-
505-
private function doSetUp()
506-
{
507-
// ...
508-
}
509-
510-
protected function doSetUp(): void
511-
{
512-
// ...
513-
}
514-
}
515-
516490
Using Namespaced PHPUnit Classes
517491
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
518492

0 commit comments

Comments
 (0)