|
|
|
|
@ -86,6 +86,7 @@ Capsule::table('user')->insert([
|
|
|
|
|
['id' => 1, 'email' => 'ok@example.com'],
|
|
|
|
|
['id' => 2, 'email' => 'unknown@example.com'],
|
|
|
|
|
['id' => 3, 'email' => 'blocked@example.com'],
|
|
|
|
|
['id' => 4, 'email' => 'new@example.com'],
|
|
|
|
|
]);
|
|
|
|
|
$insertNotice = static function (int $id, string $status = 'scheduled') use ($now): void {
|
|
|
|
|
Capsule::table('cloud_maintenance_notices')->insert([
|
|
|
|
|
@ -190,6 +191,15 @@ $assert($row->status === 'skipped'
|
|
|
|
|
&& $notice->status === 'completed',
|
|
|
|
|
'Blacklisted delivery was sent or aggregated as a failure.');
|
|
|
|
|
|
|
|
|
|
$insertNotice(6);
|
|
|
|
|
$insertRecipient(7, 6, 4, 'old@example.com', 'pending', $now);
|
|
|
|
|
$assert($delivery->tick() === true && count($sent) === 2,
|
|
|
|
|
'An email-changed recipient did not settle without transport.');
|
|
|
|
|
$row = Capsule::table('cloud_maintenance_notice_recipients')->find(7);
|
|
|
|
|
$assert($row->status === 'skipped'
|
|
|
|
|
&& $row->last_error_code === 'recipient_email_changed',
|
|
|
|
|
'Frozen recipient PII was sent after the account email changed.');
|
|
|
|
|
|
|
|
|
|
$insertNotice(4);
|
|
|
|
|
$insertRecipient(5, 4, 99, 'deleted@example.com', 'pending', $now);
|
|
|
|
|
$assert($delivery->tick() === true && count($sent) === 2
|
|
|
|
|
@ -198,7 +208,7 @@ $assert($delivery->tick() === true && count($sent) === 2
|
|
|
|
|
'A deleted user still reached the transport.');
|
|
|
|
|
|
|
|
|
|
$insertNotice(5);
|
|
|
|
|
$insertRecipient(6, 5, 1, 'fenced@example.com', 'pending', $now);
|
|
|
|
|
$insertRecipient(6, 5, 1, 'ok@example.com', 'pending', $now);
|
|
|
|
|
$fenced = new CloudMaintenanceNoticeDeliveryService(
|
|
|
|
|
static function (): bool {
|
|
|
|
|
Capsule::table('cloud_maintenance_notice_recipients')
|
|
|
|
|
|