Files
alrahma_sunday_school_api/tests/Unit/Services/BroadcastEmail/BroadcastEmailSenderOptionsServiceTest.php
T
2026-06-08 23:45:55 -04:00

24 lines
698 B
PHP

<?php
namespace Tests\Unit\Services\BroadcastEmail;
use App\Services\BroadcastEmail\BroadcastEmailSenderOptionsService;
use Tests\TestCase;
class BroadcastEmailSenderOptionsServiceTest extends TestCase
{
public function test_list_options_from_env(): void
{
$old = getenv('MAIL_SENDERS') ?: '';
putenv('MAIL_SENDERS={"general":{"name":"Office","email":"office@example.com"}}');
$service = new BroadcastEmailSenderOptionsService();
$options = $service->listOptions();
$this->assertSame('general', $options[0]['key']);
$this->assertSame('Office <office@example.com>', $options[0]['label']);
putenv('MAIL_SENDERS=' . $old);
}
}