diff --git a/components/var_dumper.rst b/components/var_dumper.rst index 5c87cd78fc7..40d0e758f01 100644 --- a/components/var_dumper.rst +++ b/components/var_dumper.rst @@ -131,7 +131,9 @@ This will provide you with two new assertions: Example:: - class ExampleTest extends \PHPUnit_Framework_TestCase + use PHPUnit\Framework\TestCase; + + class ExampleTest extends TestCase { use \Symfony\Component\VarDumper\Test\VarDumperTestTrait; diff --git a/console.rst b/console.rst index 0a9c7a2ebf8..99f71062aa3 100644 --- a/console.rst +++ b/console.rst @@ -258,7 +258,7 @@ console:: When using the Console component in a standalone project, use :class:`Symfony\\Component\\Console\\Application ` - and extend the normal ``\PHPUnit_Framework_TestCase``. + and extend the normal ``\PHPUnit\Framework\TestCase``. To be able to use the fully set up service container for your console tests you can extend your test from diff --git a/create_framework/http_foundation.rst b/create_framework/http_foundation.rst index 2d4b9a5e778..85c8c2dfb10 100644 --- a/create_framework/http_foundation.rst +++ b/create_framework/http_foundation.rst @@ -58,7 +58,9 @@ snippet of PHP code is not natural and feels ugly. Here is a tentative PHPUnit unit test for the above code:: // framework/test.php - class IndexTest extends \PHPUnit_Framework_TestCase + use PHPUnit\Framework\TestCase; + + class IndexTest extends TestCase { public function testHello() { diff --git a/create_framework/unit_testing.rst b/create_framework/unit_testing.rst index d4f40c17e78..de52439d74e 100644 --- a/create_framework/unit_testing.rst +++ b/create_framework/unit_testing.rst @@ -72,13 +72,14 @@ We are now ready to write our first test:: // example.com/tests/Simplex/Tests/FrameworkTest.php namespace Simplex\Tests; + use PHPUnit\Framework\TestCase; use Simplex\Framework; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface; use Symfony\Component\Routing; use Symfony\Component\Routing\Exception\ResourceNotFoundException; - class FrameworkTest extends \PHPUnit_Framework_TestCase + class FrameworkTest extends TestCase { public function testNotFoundHandling() { diff --git a/testing.rst b/testing.rst index 1e57b26447c..dbb42ffb458 100644 --- a/testing.rst +++ b/testing.rst @@ -71,8 +71,9 @@ of your bundle:: namespace AppBundle\Tests\Util; use AppBundle\Util\Calculator; + use PHPUnit\Framework\TestCase; - class CalculatorTest extends \PHPUnit_Framework_TestCase + class CalculatorTest extends TestCase { public function testAdd() { diff --git a/testing/database.rst b/testing/database.rst index 0b610715ddb..6ea86ec45c6 100644 --- a/testing/database.rst +++ b/testing/database.rst @@ -63,8 +63,9 @@ it's easy to pass a mock object within a test:: use AppBundle\Salary\SalaryCalculator; use Doctrine\ORM\EntityRepository; use Doctrine\Common\Persistence\ObjectManager; + use PHPUnit\Framework\TestCase; - class SalaryCalculatorTest extends \PHPUnit_Framework_TestCase + class SalaryCalculatorTest extends TestCase { public function testCalculateTotalSalary() {