Files
amare/tests/Feature/ProductionProviders/ResendMailConfigTest.php
Manoel Freitas cafb1167ac feat: wire Resend mail and Cloudflare R2 storage (#4)
Add production provider deps/config so transactional email and CMS
media can use Resend and a dedicated r2 disk with custom-domain URLs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 21:00:16 -03:00

29 lines
861 B
PHP

<?php
declare(strict_types=1);
afterEach(function (): void {
putenv('RESEND_API_KEY');
unset($_ENV['RESEND_API_KEY'], $_SERVER['RESEND_API_KEY']);
});
it('defines the resend mailer transport', function (): void {
expect(config('mail.mailers.resend.transport'))->toBe('resend');
});
it('resolves the resend api key from RESEND_API_KEY', function (): void {
putenv('RESEND_API_KEY=test-resend-key');
$_ENV['RESEND_API_KEY'] = 'test-resend-key';
$_SERVER['RESEND_API_KEY'] = 'test-resend-key';
$services = require config_path('services.php');
expect($services['resend']['key'])->toBe('test-resend-key');
});
it('defaults the mailer to log in config when MAIL_MAILER is unset', function (): void {
$contents = file_get_contents(config_path('mail.php'));
expect($contents)->toContain("env('MAIL_MAILER', 'log')");
});