Skip to content

Commit cd97bb2

Browse files
Make tests support phpunit 8
1 parent ba5ee7c commit cd97bb2

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

Tests/Authorization/AuthorizationCheckerTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,20 @@
1212
namespace Symfony\Component\Security\Core\Tests\Authorization;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
1617
use Symfony\Component\Security\Core\Authorization\AuthorizationChecker;
1718

1819
class AuthorizationCheckerTest extends TestCase
1920
{
21+
use ForwardCompatTestTrait;
22+
2023
private $authenticationManager;
2124
private $accessDecisionManager;
2225
private $authorizationChecker;
2326
private $tokenStorage;
2427

25-
protected function setUp()
28+
private function doSetUp()
2629
{
2730
$this->authenticationManager = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface')->getMock();
2831
$this->accessDecisionManager = $this->getMockBuilder('Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface')->getMock();

Tests/Authorization/Voter/VoterTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@
1212
namespace Symfony\Component\Security\Core\Tests\Authorization\Voter;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
1617
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
1718
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
1819

1920
class VoterTest extends TestCase
2021
{
22+
use ForwardCompatTestTrait;
23+
2124
protected $token;
2225

23-
protected function setUp()
26+
private function doSetUp()
2427
{
2528
$this->token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock();
2629
}

Tests/Encoder/Argon2iPasswordEncoderTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,19 @@
1212
namespace Symfony\Component\Security\Core\Tests\Encoder;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Component\Security\Core\Encoder\Argon2iPasswordEncoder;
1617

1718
/**
1819
* @author Zan Baldwin <[email protected]>
1920
*/
2021
class Argon2iPasswordEncoderTest extends TestCase
2122
{
23+
use ForwardCompatTestTrait;
24+
2225
const PASSWORD = 'password';
2326

24-
protected function setUp()
27+
private function doSetUp()
2528
{
2629
if (!Argon2iPasswordEncoder::isSupported()) {
2730
$this->markTestSkipped('Argon2i algorithm is not supported.');

Tests/Validator/Constraints/UserPasswordValidatorTest.php

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

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

14+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1415
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
1516
use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface;
1617
use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface;
@@ -23,6 +24,8 @@
2324
*/
2425
abstract class UserPasswordValidatorTest extends ConstraintValidatorTestCase
2526
{
27+
use ForwardCompatTestTrait;
28+
2629
const PASSWORD = 's3Cr3t';
2730
const SALT = '^S4lt$';
2831

@@ -46,7 +49,7 @@ protected function createValidator()
4649
return new UserPasswordValidator($this->tokenStorage, $this->encoderFactory);
4750
}
4851

49-
protected function setUp()
52+
private function doSetUp()
5053
{
5154
$user = $this->createUser();
5255
$this->tokenStorage = $this->createTokenStorage($user);

0 commit comments

Comments
 (0)