```
✨ 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:
@@ -9,23 +9,25 @@ use App\Service\System\DatabaseDumper;
|
||||
use App\Service\System\ZipArchiver;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\Query;
|
||||
use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Console\Application;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
|
||||
#[AllowMockObjectsWithoutExpectations]
|
||||
class BackupCommandTest extends TestCase
|
||||
{
|
||||
private MockObject&KernelInterface $kernel;
|
||||
private MockObject&EntityManagerInterface $entityManager;
|
||||
private MockObject&Mailer $mailer;
|
||||
private MockObject&DatabaseDumper $databaseDumper;
|
||||
private MockObject&ZipArchiver $zipArchiver;
|
||||
private $kernel;
|
||||
private $entityManager;
|
||||
private $mailer;
|
||||
private $databaseDumper;
|
||||
private $zipArchiver;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->kernel = $this->createMock(KernelInterface::class);
|
||||
$this->kernel = $this->createStub(KernelInterface::class);
|
||||
$this->entityManager = $this->createMock(EntityManagerInterface::class);
|
||||
$this->mailer = $this->createMock(Mailer::class);
|
||||
$this->databaseDumper = $this->createMock(DatabaseDumper::class);
|
||||
@@ -49,7 +51,7 @@ class BackupCommandTest extends TestCase
|
||||
// Cleanup expectations
|
||||
// Mocking Query class which might be final. If so, we'll see an error.
|
||||
// But commonly in Doctrine mocks, we have to deal with this.
|
||||
$query = $this->createMock(Query::class);
|
||||
$query = $this->createStub(Query::class);
|
||||
$query->method('setParameter')->willReturnSelf();
|
||||
$query->method('execute');
|
||||
$this->entityManager->method('createQuery')->willReturn($query);
|
||||
@@ -90,7 +92,7 @@ class BackupCommandTest extends TestCase
|
||||
);
|
||||
|
||||
$application = new Application();
|
||||
$application->add($command);
|
||||
$application->addCommand($command);
|
||||
$commandTester = new CommandTester($application->find('app:backup'));
|
||||
|
||||
$commandTester->execute([]);
|
||||
@@ -132,7 +134,7 @@ class BackupCommandTest extends TestCase
|
||||
);
|
||||
|
||||
// Cleanup expectations
|
||||
$query = $this->createMock(Query::class);
|
||||
$query = $this->createStub(Query::class);
|
||||
$query->method('setParameter')->willReturnSelf();
|
||||
$query->method('execute');
|
||||
$this->entityManager->method('createQuery')->willReturn($query);
|
||||
@@ -147,7 +149,7 @@ class BackupCommandTest extends TestCase
|
||||
);
|
||||
|
||||
$application = new Application();
|
||||
$application->add($command);
|
||||
$application->addCommand($command);
|
||||
$commandTester = new CommandTester($application->find('app:backup'));
|
||||
|
||||
$commandTester->execute([]);
|
||||
|
||||
Reference in New Issue
Block a user