test(platform-orders): cover bmpa_processable_only combined filters without enforcing UI sanitization

This commit is contained in:
萝卜
2026-03-18 03:58:57 +08:00
parent 17e78c2ab2
commit b419d95b0b

View File

@@ -0,0 +1,31 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderBmpaProcessableOnlyShouldNotBreakWhenCombinedWithOtherFiltersTest 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_platform_orders_bmpa_processable_only_can_coexist_with_other_filters_without_error(): void
{
$this->loginAsPlatformAdmin();
// 说明bmpa_processable_only 本身在 applyFilters() 会强制限定 status/payment_status 等口径。
// 若用户同时带了其它筛选(例如 status/payment_status/sync_status/bmpa_failed_only结果可能为空但不应报错/500。
$this->get('/admin/platform-orders?bmpa_processable_only=1&status=activated&payment_status=paid&sync_status=synced&bmpa_failed_only=1')
->assertOk();
}
}