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

Skip to content

use namespaced PHPUnit classes #7556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion components/var_dumper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion console.rst
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ console::

When using the Console component in a standalone project, use
:class:`Symfony\\Component\\Console\\Application <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
Expand Down
4 changes: 3 additions & 1 deletion create_framework/http_foundation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
3 changes: 2 additions & 1 deletion create_framework/unit_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
3 changes: 2 additions & 1 deletion testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
3 changes: 2 additions & 1 deletion testing/database.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down