```
✨ feat(revervation): [Ajoute la création de session de réservation et le flow] 🐛 fix(PurgeCommandTest): [Utilise addCommand au lieu de add pour les commandes] 📝 chore(deps): [Mise à jour des dépendances Composer et corrections] 🐛 fix(KeycloakAuthenticator): [Corrige le type nullable de l'exception start] ✨ feat(Customer): [Ajoute les sessions de commandes aux entités Customer] ♻️ refactor(AppLogger): [Refactorise l'AppLogger pour obtenir l'UserAgent] ✨ feat(FlowReserve): [Ajoute une action de validation du panier] ```
This commit is contained in:
36
tests/Security/PasswordGeneratorTest.php
Normal file
36
tests/Security/PasswordGeneratorTest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Tests\Security;
|
||||
|
||||
use App\Security\PasswordGenerator;
|
||||
use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
#[AllowMockObjectsWithoutExpectations]
|
||||
class PasswordGeneratorTest extends TestCase
|
||||
{
|
||||
public function testGenerateLength()
|
||||
{
|
||||
$generator = new PasswordGenerator(16);
|
||||
$password = $generator->generate();
|
||||
|
||||
$this->assertEquals(16, strlen($password));
|
||||
}
|
||||
|
||||
public function testGenerateContainsRequiredCharacters()
|
||||
{
|
||||
$generator = new PasswordGenerator(12);
|
||||
$password = $generator->generate();
|
||||
|
||||
$this->assertMatchesRegularExpression('/[a-z]/', $password);
|
||||
$this->assertMatchesRegularExpression('/[A-Z]/', $password);
|
||||
$this->assertMatchesRegularExpression('/[0-9]/', $password);
|
||||
$this->assertMatchesRegularExpression('/[@#_\-]/', $password);
|
||||
}
|
||||
|
||||
public function testInvalidLengthThrowsException()
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
new PasswordGenerator(3);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user