<?php

declare(strict_types=1);

namespace CpCreation\VitiCore\Tests\Marketing;

use CpCreation\VitiCore\Bridge\Symfony\Bundle\Mailer\Command\ReviewInvitationMailCommand;
use CpCreation\VitiCore\Bridge\Symfony\Bundle\Mailer\Command\ReviewInvitationReminderMailCommand;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Yaml\Yaml;

final class ReviewInvitationMessengerRoutingTest extends TestCase
{
    public function testInvitationEmailsAreQueuedForRetryableDelivery(): void
    {
        $configuration = Yaml::parseFile(
            __DIR__ . '/../../src/Bridge/Symfony/Bundle/Resources/config/packages/messenger.yaml',
        );
        $routing = $configuration['framework']['messenger']['routing'];

        self::assertSame('async', $routing[ReviewInvitationMailCommand::class]);
        self::assertSame('async', $routing[ReviewInvitationReminderMailCommand::class]);
    }
}
