AWS SES
Testing And Operations
Test fakes, commands, migrations, worker setup, and production runbooks for Vortos SES.
Testing And Operations
Test Driver
Use the null driver in automated tests:
use Vortos\AwsSes\DependencyInjection\VortosAwsSesConfig;
return static function (VortosAwsSesConfig $config): void {
$config->driver('null');
};The package includes Vortos\AwsSes\Testing\SesMailerFake for assertions.
Functional Test Pattern
use Vortos\AwsSes\Testing\SesMailerFake;
final class RegistrationNotificationTest extends TestCase
{
public function test_it_queues_approval_email(): void
{
self::getContainer()->get(CommandBus::class)
->dispatch(new ApproveRegistration('reg_123'));
$mailer = self::getContainer()->get(SesMailerFake::class);
self::assertTrue($mailer->sent()->hasRecipient('athlete@example.com'));
}
}Commands
php bin/console vortos:ses:send:test you@example.com
php bin/console vortos:ses:quota
php bin/console vortos:ses:outbox:relay
php bin/console vortos:ses:outbox:relay --once
php bin/console vortos:ses:suppression:sync
php bin/console vortos:ses:suppression:sync --dry-run
php bin/console vortos:ses:suppression:list
php bin/console vortos:worker:install --worker=aws-ses-outbox-relayMake commands, when the Make package is installed:
php bin/console vortos:ses:make:bounce-handler NotifySupport --context=Notification
php bin/console vortos:ses:make:complaint-handler UnsubscribeUser --context=Notification
php bin/console vortos:ses:make:email-middleware TenantHeader --context=Notification --priority=500Supervisor
List registered workers:
php bin/console vortos:worker:listInstall the SES relay:
php bin/console vortos:worker:install --worker=aws-ses-outbox-relayPreview without writing:
php bin/console vortos:worker:install --worker=aws-ses-outbox-relay --dry-runSee Worker Supervisor for managed block behavior and deployment notes.
Deployment Runbook
- Deploy code.
- Run migrations.
- Verify SES env vars and IAM credentials.
- Run
vortos:ses:quota. - Run
vortos:ses:send:testto a controlled recipient. - Install or update the supervisor worker config.
- Restart or reload worker processes.
- Watch outbox lag and provider errors.
Integration Tests
Do not use LocalStack for package CI. Provider integration tests should be gated behind real SES credentials in CI and skipped when credentials are absent.
Separate fast tests from provider tests
Use unit and functional tests for normal CI speed. Run real SES integration tests in a protected CI job with restricted credentials and known verified identities.