Skip to content

Commit 6b0ed01

Browse files
peterrehmfabpot
authored andcommitted
Update to PHPUnit namespaces
1 parent 6556028 commit 6b0ed01

31 files changed

+66
-33
lines changed

Tests/ConstraintTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Validator\Tests;
1313

14+
use PHPUnit\Framework\TestCase;
1415
use Symfony\Component\Validator\Constraint;
1516
use Symfony\Component\Validator\Tests\Fixtures\ClassConstraint;
1617
use Symfony\Component\Validator\Tests\Fixtures\ConstraintA;
@@ -19,7 +20,7 @@
1920
use Symfony\Component\Validator\Tests\Fixtures\ConstraintWithValue;
2021
use Symfony\Component\Validator\Tests\Fixtures\ConstraintWithValueAsDefault;
2122

22-
class ConstraintTest extends \PHPUnit_Framework_TestCase
23+
class ConstraintTest extends TestCase
2324
{
2425
public function testSetProperties()
2526
{

Tests/ConstraintViolationListTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111

1212
namespace Symfony\Component\Validator\Tests;
1313

14+
use PHPUnit\Framework\TestCase;
1415
use Symfony\Component\Validator\ConstraintViolation;
1516
use Symfony\Component\Validator\ConstraintViolationList;
1617

17-
class ConstraintViolationListTest extends \PHPUnit_Framework_TestCase
18+
class ConstraintViolationListTest extends TestCase
1819
{
1920
protected $list;
2021

Tests/ConstraintViolationTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111

1212
namespace Symfony\Component\Validator\Tests;
1313

14+
use PHPUnit\Framework\TestCase;
1415
use Symfony\Component\Validator\ConstraintViolation;
1516

16-
class ConstraintViolationTest extends \PHPUnit_Framework_TestCase
17+
class ConstraintViolationTest extends TestCase
1718
{
1819
public function testToStringHandlesArrays()
1920
{

Tests/Constraints/AbstractConstraintValidatorTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Validator\Tests\Constraints;
1313

14+
use PHPUnit\Framework\Assert;
15+
use PHPUnit\Framework\TestCase;
1416
use Symfony\Component\Validator\Constraint;
1517
use Symfony\Component\Validator\Constraints\NotNull;
1618
use Symfony\Component\Validator\ConstraintValidatorInterface;
@@ -26,7 +28,7 @@
2628
/**
2729
* @author Bernhard Schussek <[email protected]>
2830
*/
29-
abstract class AbstractConstraintValidatorTest extends \PHPUnit_Framework_TestCase
31+
abstract class AbstractConstraintValidatorTest extends TestCase
3032
{
3133
/**
3234
* @var ExecutionContextInterface
@@ -411,12 +413,12 @@ public function assertRaised()
411413

412414
$violations = iterator_to_array($this->context->getViolations());
413415

414-
\PHPUnit_Framework_Assert::assertSame($expectedCount = count($expected), $violationsCount = count($violations), sprintf('%u violation(s) expected. Got %u.', $expectedCount, $violationsCount));
416+
Assert::assertSame($expectedCount = count($expected), $violationsCount = count($violations), sprintf('%u violation(s) expected. Got %u.', $expectedCount, $violationsCount));
415417

416418
reset($violations);
417419

418420
foreach ($expected as $violation) {
419-
\PHPUnit_Framework_Assert::assertEquals($violation, current($violations));
421+
Assert::assertEquals($violation, current($violations));
420422
next($violations);
421423
}
422424
}

Tests/Constraints/AllTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111

1212
namespace Symfony\Component\Validator\Tests\Constraints;
1313

14+
use PHPUnit\Framework\TestCase;
1415
use Symfony\Component\Validator\Constraints\All;
1516
use Symfony\Component\Validator\Constraints\Valid;
1617

1718
/**
1819
* @author Bernhard Schussek <[email protected]>
1920
*/
20-
class AllTest extends \PHPUnit_Framework_TestCase
21+
class AllTest extends TestCase
2122
{
2223
/**
2324
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException

Tests/Constraints/CollectionTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Validator\Tests\Constraints;
1313

14+
use PHPUnit\Framework\TestCase;
1415
use Symfony\Component\Validator\Constraints\Collection;
1516
use Symfony\Component\Validator\Constraints\Email;
1617
use Symfony\Component\Validator\Constraints\Optional;
@@ -20,7 +21,7 @@
2021
/**
2122
* @author Bernhard Schussek <[email protected]>
2223
*/
23-
class CollectionTest extends \PHPUnit_Framework_TestCase
24+
class CollectionTest extends TestCase
2425
{
2526
/**
2627
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException

Tests/Constraints/CompositeTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Validator\Tests\Constraints;
1313

14+
use PHPUnit\Framework\TestCase;
1415
use Symfony\Component\Validator\Constraints\Composite;
1516
use Symfony\Component\Validator\Constraints\NotBlank;
1617
use Symfony\Component\Validator\Constraints\NotNull;
@@ -34,7 +35,7 @@ public function getDefaultOption()
3435
/**
3536
* @author Bernhard Schussek <[email protected]>
3637
*/
37-
class CompositeTest extends \PHPUnit_Framework_TestCase
38+
class CompositeTest extends TestCase
3839
{
3940
public function testMergeNestedGroupsIfNoExplicitParentGroup()
4041
{

Tests/Constraints/FileTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111

1212
namespace Symfony\Component\Validator\Tests\Constraints;
1313

14+
use PHPUnit\Framework\TestCase;
1415
use Symfony\Component\Validator\Constraints\File;
1516
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
1617

17-
class FileTest extends \PHPUnit_Framework_TestCase
18+
class FileTest extends TestCase
1819
{
1920
/**
2021
* @param mixed $maxSize

Tests/Constraints/GroupSequenceTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111

1212
namespace Symfony\Component\Validator\Tests\Constraints;
1313

14+
use PHPUnit\Framework\TestCase;
1415
use Symfony\Component\Validator\Constraints\GroupSequence;
1516

1617
/**
1718
* @author Bernhard Schussek <[email protected]>
1819
*/
19-
class GroupSequenceTest extends \PHPUnit_Framework_TestCase
20+
class GroupSequenceTest extends TestCase
2021
{
2122
public function testCreate()
2223
{

Tests/Constraints/RegexTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111

1212
namespace Constraints;
1313

14+
use PHPUnit\Framework\TestCase;
1415
use Symfony\Component\Validator\Constraints\Regex;
1516

1617
/**
1718
* @author Bernhard Schussek <[email protected]>
1819
*/
19-
class RegexTest extends \PHPUnit_Framework_TestCase
20+
class RegexTest extends TestCase
2021
{
2122
public function testConstraintGetDefaultOption()
2223
{

0 commit comments

Comments
 (0)