Keep similar-ai from tripping the global circuit on a lone URL 502, clamp Qdrant search to 100, and add Server-Timing plus slow-request logging. Studio shared props, Academy S3 exists caching, heat chunking, and Redis/scheduler hygiene stay in this rollout.
49 lines
1.9 KiB
PHP
49 lines
1.9 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Unit;
|
|
|
|
use App\Jobs\SendVerificationEmailJob;
|
|
use App\Mail\EmailChangedSecurityAlertMail;
|
|
use App\Mail\EmailChangeVerificationCodeMail;
|
|
use App\Mail\RegistrationVerificationMail;
|
|
use Tests\TestCase;
|
|
|
|
final class HorizonMailQueueTest extends TestCase
|
|
{
|
|
public function test_horizon_defines_a_mail_supervisor_that_consumes_only_mail(): void
|
|
{
|
|
$defaults = config('horizon.defaults.supervisor-mail');
|
|
|
|
$this->assertIsArray($defaults);
|
|
$this->assertSame(['mail'], $defaults['queue']);
|
|
$this->assertSame('redis', $defaults['connection']);
|
|
$this->assertGreaterThanOrEqual(5, (int) $defaults['tries']);
|
|
$this->assertLessThanOrEqual(
|
|
(int) config('queue.connections.redis.retry_after'),
|
|
(int) $defaults['timeout'],
|
|
);
|
|
}
|
|
|
|
public function test_production_and_local_horizon_environments_enable_the_mail_supervisor(): void
|
|
{
|
|
$this->assertArrayHasKey('supervisor-mail', config('horizon.environments.production'));
|
|
$this->assertArrayHasKey('supervisor-mail', config('horizon.environments.local'));
|
|
}
|
|
|
|
public function test_verification_and_security_mailables_use_the_mail_queue(): void
|
|
{
|
|
$this->assertSame('mail', (new SendVerificationEmailJob(1, '[email protected]', 'token', 1, '127.0.0.1'))->queue);
|
|
$this->assertSame('mail', (new RegistrationVerificationMail('token'))->queue);
|
|
$this->assertSame('mail', (new EmailChangeVerificationCodeMail('123456', 15))->queue);
|
|
$this->assertSame('mail', (new EmailChangedSecurityAlertMail('[email protected]'))->queue);
|
|
}
|
|
|
|
public function test_default_and_messaging_supervisors_do_not_steal_the_mail_queue(): void
|
|
{
|
|
$this->assertNotContains('mail', config('horizon.defaults.supervisor-default.queue'));
|
|
$this->assertNotContains('mail', config('horizon.defaults.supervisor-messaging.queue'));
|
|
}
|
|
}
|