Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ac5835f

Browse files
committed
minor #7556 use namespaced PHPUnit classes (xabbuh)
This PR was merged into the 2.7 branch. Discussion ---------- use namespaced PHPUnit classes Commits ------- 86051ee use namespaced PHPUnit classes
2 parents 91de5cd + 86051ee commit ac5835f

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed

components/var_dumper.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ This will provide you with two new assertions:
131131

132132
Example::
133133

134-
class ExampleTest extends \PHPUnit_Framework_TestCase
134+
use PHPUnit\Framework\TestCase;
135+
136+
class ExampleTest extends TestCase
135137
{
136138
use \Symfony\Component\VarDumper\Test\VarDumperTestTrait;
137139

console.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ console::
258258

259259
When using the Console component in a standalone project, use
260260
:class:`Symfony\\Component\\Console\\Application <Symfony\\Component\\Console\\Application>`
261-
and extend the normal ``\PHPUnit_Framework_TestCase``.
261+
and extend the normal ``\PHPUnit\Framework\TestCase``.
262262

263263
To be able to use the fully set up service container for your console tests
264264
you can extend your test from

create_framework/http_foundation.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ snippet of PHP code is not natural and feels ugly. Here is a tentative PHPUnit
5858
unit test for the above code::
5959

6060
// framework/test.php
61-
class IndexTest extends \PHPUnit_Framework_TestCase
61+
use PHPUnit\Framework\TestCase;
62+
63+
class IndexTest extends TestCase
6264
{
6365
public function testHello()
6466
{

create_framework/unit_testing.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,14 @@ We are now ready to write our first test::
7272
// example.com/tests/Simplex/Tests/FrameworkTest.php
7373
namespace Simplex\Tests;
7474

75+
use PHPUnit\Framework\TestCase;
7576
use Simplex\Framework;
7677
use Symfony\Component\HttpFoundation\Request;
7778
use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
7879
use Symfony\Component\Routing;
7980
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
8081

81-
class FrameworkTest extends \PHPUnit_Framework_TestCase
82+
class FrameworkTest extends TestCase
8283
{
8384
public function testNotFoundHandling()
8485
{

testing.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ of your bundle::
7171
namespace AppBundle\Tests\Util;
7272

7373
use AppBundle\Util\Calculator;
74+
use PHPUnit\Framework\TestCase;
7475

75-
class CalculatorTest extends \PHPUnit_Framework_TestCase
76+
class CalculatorTest extends TestCase
7677
{
7778
public function testAdd()
7879
{

testing/database.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ it's easy to pass a mock object within a test::
6363
use AppBundle\Salary\SalaryCalculator;
6464
use Doctrine\ORM\EntityRepository;
6565
use Doctrine\Common\Persistence\ObjectManager;
66+
use PHPUnit\Framework\TestCase;
6667

67-
class SalaryCalculatorTest extends \PHPUnit_Framework_TestCase
68+
class SalaryCalculatorTest extends TestCase
6869
{
6970
public function testCalculateTotalSalary()
7071
{

0 commit comments

Comments
 (0)