feat(mail) : commande app:mail:sync avec options --folder et --dry-run
This commit is contained in:
40
tests/Functional/Command/MailSyncCommandTest.php
Normal file
40
tests/Functional/Command/MailSyncCommandTest.php
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user