feat(mail) : commande app:mail:sync avec options --folder et --dry-run

This commit is contained in:
2026-05-19 23:38:40 +02:00
parent c47434b502
commit 1fb7460f8e
2 changed files with 150 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
namespace App\Tests\Functional\Command;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Tester\CommandTester;
/**
* @internal
*/
class MailSyncCommandTest extends KernelTestCase
{
public function testCommandExitsSuccessWhenMailDisabled(): void
{
self::bootKernel();
$application = new Application(self::$kernel);
$command = $application->find('app:mail:sync');
$tester = new CommandTester($command);
$exitCode = $tester->execute([]);
self::assertSame(0, $exitCode);
self::assertStringContainsString('disabled', strtolower($tester->getDisplay()));
}
public function testCommandDryRunExitsSuccess(): void
{
self::bootKernel();
$application = new Application(self::$kernel);
$command = $application->find('app:mail:sync');
$tester = new CommandTester($command);
$exitCode = $tester->execute(['--dry-run' => true]);
self::assertSame(0, $exitCode);
}
}