Governance: block batch BMPA when renewal missing subscription filter present

This commit is contained in:
萝卜
2026-03-17 01:40:51 +08:00
parent 810c4894fd
commit 6cd8c34245
2 changed files with 43 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderBatchMarkPaidAndActivateShouldBlockWhenRenewalMissingSubscriptionTest extends TestCase
{
use RefreshDatabase;
protected function loginAsPlatformAdmin(): void
{
$this->seed();
$this->post('/admin/login', [
'email' => 'platform.admin@demo.local',
'password' => 'Platform@123456',
])->assertRedirect('/admin');
}
public function test_batch_mark_paid_and_activate_should_block_when_renewal_missing_subscription_filter_present(): void
{
$this->loginAsPlatformAdmin();
$res = $this->post('/admin/platform-orders/batch-mark-paid-and-activate', [
'scope' => 'filtered',
'renewal_missing_subscription' => '1',
// 即便其它条件满足 BMPA 口径,也应被治理集合优先阻断
'status' => 'pending',
'payment_status' => 'unpaid',
'limit' => 50,
]);
$res->assertRedirect();
$res->assertSessionHas('warning');
}
}