```
✨ 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:
50
tests/Entity/PrestaireTest.php
Normal file
50
tests/Entity/PrestaireTest.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Tests\Entity;
|
||||
|
||||
use App\Entity\EtatLieux;
|
||||
use App\Entity\Prestaire;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class PrestaireTest extends TestCase
|
||||
{
|
||||
public function testGettersAndSetters()
|
||||
{
|
||||
$prestaire = new Prestaire();
|
||||
$prestaire->setEmail('prestaire@test.com');
|
||||
$prestaire->setName('PrestaireName');
|
||||
$prestaire->setSurname('PrestaireSurname');
|
||||
$prestaire->setPhone('0123456789');
|
||||
$prestaire->setRoles(['ROLE_PRESTAIRE']);
|
||||
|
||||
$this->assertEquals('prestaire@test.com', $prestaire->getEmail());
|
||||
$this->assertEquals('PrestaireName', $prestaire->getName());
|
||||
$this->assertEquals('PrestaireSurname', $prestaire->getSurname());
|
||||
$this->assertEquals('0123456789', $prestaire->getPhone());
|
||||
$this->assertContains('ROLE_PRESTAIRE', $prestaire->getRoles());
|
||||
// $this->assertNull($prestaire->getPassword()); // As per entity's getPassword() TODO
|
||||
$this->assertEquals('prestaire@test.com', $prestaire->getUserIdentifier());
|
||||
}
|
||||
|
||||
public function testEtatLieuxesCollection()
|
||||
{
|
||||
$prestaire = new Prestaire();
|
||||
$etatLieux = new EtatLieux();
|
||||
|
||||
$this->assertCount(0, $prestaire->getEtatLieuxes());
|
||||
$prestaire->addEtatLieux($etatLieux);
|
||||
$this->assertCount(1, $prestaire->getEtatLieuxes());
|
||||
$this->assertSame($prestaire, $etatLieux->getPrestataire());
|
||||
|
||||
$prestaire->removeEtatLieux($etatLieux);
|
||||
$this->assertCount(0, $prestaire->getEtatLieuxes());
|
||||
$this->assertNull($etatLieux->getPrestataire());
|
||||
}
|
||||
|
||||
public function testEraseCredentials()
|
||||
{
|
||||
$prestaire = new Prestaire();
|
||||
$prestaire->eraseCredentials(); // Should do nothing as per entity's eraseCredentials() TODO
|
||||
$this->assertTrue(true); // Just ensure it doesn't crash
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user