You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.4 KiB
PHP
36 lines
1.4 KiB
PHP
<?php
|
|
|
|
$root = dirname(__DIR__);
|
|
$deletion = file_get_contents(
|
|
$root . '/app/Services/UserDataDeletionService.php'
|
|
);
|
|
$assert = static function (bool $condition, string $message): void {
|
|
if (!$condition) {
|
|
throw new RuntimeException($message);
|
|
}
|
|
};
|
|
|
|
$assert(str_contains($deletion,
|
|
"['cloud_service_compensation_recipients', 'user_id']")
|
|
&& str_contains($deletion,
|
|
"['cloud_service_compensation_items', 'user_id']"),
|
|
'Account deletion does not remove compensation tenant PII.');
|
|
$assert(!str_contains($deletion,
|
|
"['cloud_service_compensations', 'requested_by_user_id']"),
|
|
'Account deletion must retain compensation batch audit.');
|
|
$assert(str_contains($deletion,
|
|
"'cloud_service_compensations as compensation_batch'")
|
|
&& str_contains($deletion,
|
|
"->whereIn('compensation_batch.state', [")
|
|
&& str_contains($deletion, "'pending', 'applying'")
|
|
&& str_contains($deletion, '进行中的实例补偿'),
|
|
'Account deletion can truncate an active compensation batch.');
|
|
$assert(str_contains($deletion,
|
|
"->whereIn('user_id', \$ids)->whereIn('status', [")
|
|
&& str_contains($deletion, "'pending', 'sending'")
|
|
&& str_contains($deletion, "->get(['id', 'status'])")
|
|
&& str_contains($deletion, '投递中的补偿通知'),
|
|
'Account deletion does not lock queued and sending compensation mail.');
|
|
|
|
echo "Service compensation account-deletion contracts passed.\n";
|