-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dropped symfony 4 support in favor of symfony 6
- Loading branch information
Showing
3 changed files
with
12 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,14 @@ | |
|
||
use PasswordValidator\Constraints\Password; | ||
use PasswordValidator\Constraints\PasswordValidator; | ||
use Symfony\Component\Security\Core\User\InMemoryUser; | ||
use Symfony\Component\Validator\Exception\MissingOptionsException; | ||
|
||
class PasswordValidatorTest extends \Symfony\Component\Validator\Test\ConstraintValidatorTestCase | ||
{ | ||
public function testNotEqualsUserName() | ||
{ | ||
$user = new Symfony\Component\Security\Core\User\User('[email protected]', '[email protected]'); | ||
$user = new InMemoryUser('[email protected]', '[email protected]'); | ||
$passwordConstraint = new Password(['plainPasswordAccessor' => 'getPassword', 'plainPasswordProperty' => 'password']); | ||
|
||
$this->validator->validate($user, $passwordConstraint); | ||
|
@@ -21,7 +22,7 @@ public function testNotEqualsUserName() | |
|
||
public function testNotContainsUserName() | ||
{ | ||
$user = new Symfony\Component\Security\Core\User\User('[email protected]', '[email protected]'); | ||
$user = new InMemoryUser('[email protected]', '[email protected]'); | ||
$passwordConstraint = new Password(['plainPasswordAccessor' => 'getPassword', 'plainPasswordProperty' => 'password']); | ||
|
||
$this->validator->validate($user, $passwordConstraint); | ||
|
@@ -32,7 +33,7 @@ public function testNotContainsUserName() | |
|
||
public function testLength() | ||
{ | ||
$user = new Symfony\Component\Security\Core\User\User('[email protected]', 'Foo1'); | ||
$user = new InMemoryUser('[email protected]', 'Foo1'); | ||
$passwordConstraint = new Password(['plainPasswordAccessor' => 'getPassword', 'plainPasswordProperty' => 'password']); | ||
|
||
$this->validator->validate($user, $passwordConstraint); | ||
|
@@ -43,7 +44,7 @@ public function testLength() | |
|
||
public function testNumber() | ||
{ | ||
$user = new Symfony\Component\Security\Core\User\User('[email protected]', '[email protected]'); | ||
$user = new InMemoryUser('[email protected]', '[email protected]'); | ||
$passwordConstraint = new Password(['plainPasswordAccessor' => 'getPassword', 'plainPasswordProperty' => 'password']); | ||
|
||
$this->validator->validate($user, $passwordConstraint); | ||
|
@@ -54,7 +55,7 @@ public function testNumber() | |
|
||
public function testUpperCase() | ||
{ | ||
$user = new Symfony\Component\Security\Core\User\User('[email protected]', '[email protected]'); | ||
$user = new InMemoryUser('[email protected]', '[email protected]'); | ||
$passwordConstraint = new Password(['plainPasswordAccessor' => 'getPassword', 'plainPasswordProperty' => 'password']); | ||
|
||
$this->validator->validate($user, $passwordConstraint); | ||
|
@@ -65,7 +66,7 @@ public function testUpperCase() | |
|
||
public function testLowerCase() | ||
{ | ||
$user = new Symfony\Component\Security\Core\User\User('[email protected]', 'FOOBARBAZ1'); | ||
$user = new InMemoryUser('[email protected]', 'FOOBARBAZ1'); | ||
$passwordConstraint = new Password(['plainPasswordAccessor' => 'getPassword', 'plainPasswordProperty' => 'password']); | ||
|
||
$this->validator->validate($user, $passwordConstraint); | ||
|
@@ -76,7 +77,7 @@ public function testLowerCase() | |
|
||
public function testProperPassword() | ||
{ | ||
$user = new Symfony\Component\Security\Core\User\User('[email protected]', '[email protected]'); | ||
$user = new InMemoryUser('[email protected]', '[email protected]'); | ||
$passwordConstraint = new Password(['plainPasswordAccessor' => 'getPassword', 'plainPasswordProperty' => 'password']); | ||
|
||
$this->validator->validate($user, $passwordConstraint); | ||
|
@@ -86,7 +87,7 @@ public function testProperPassword() | |
// Check whether class and property options are mixed | ||
public function testInvalidUserConfiguration() | ||
{ | ||
$user = new Symfony\Component\Security\Core\User\User('[email protected]', '[email protected]'); | ||
$user = new InMemoryUser('[email protected]', '[email protected]'); | ||
$passwordConstraint = new Password(); | ||
|
||
$this->expectException(MissingOptionsException::class); | ||
|