From 7ba1e2efa80f8df1427678816895c9f6e36676ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Wed, 18 Mar 2026 20:00:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95:=20=E5=8D=87=E7=BA=A7BMPA?= =?UTF-8?q?=E9=98=BB=E6=96=AD=E6=8F=90=E7=A4=BA=E5=85=A5=E5=8F=A3=E8=AF=AD?= =?UTF-8?q?=E4=B9=89=E6=8A=A4=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...HintShouldIncludeGoProcessableLinkTest.php | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/tests/Feature/AdminPlatformOrderIndexBatchBmpaBlockedHintShouldIncludeGoProcessableLinkTest.php b/tests/Feature/AdminPlatformOrderIndexBatchBmpaBlockedHintShouldIncludeGoProcessableLinkTest.php index 577483b..cc128b9 100644 --- a/tests/Feature/AdminPlatformOrderIndexBatchBmpaBlockedHintShouldIncludeGoProcessableLinkTest.php +++ b/tests/Feature/AdminPlatformOrderIndexBatchBmpaBlockedHintShouldIncludeGoProcessableLinkTest.php @@ -19,19 +19,31 @@ class AdminPlatformOrderIndexBatchBmpaBlockedHintShouldIncludeGoProcessableLinkT ])->assertRedirect('/admin'); } - public function test_blocked_hint_should_include_link_to_pending_unpaid_set(): void + public function test_blocked_hint_should_include_link_to_bmpa_processable_set(): void { $this->loginAsPlatformAdmin(); - // 构造一个会触发 batch_bmpa 被阻断的筛选:不给 pending+unpaid。 - $res = $this->get('/admin/platform-orders'); + // 构造一个会触发 batch_bmpa 被阻断的复杂筛选; + // blocked hint 应给出“切到可BMPA处理集合”入口,并清理冲突开关。 + $res = $this->get('/admin/platform-orders?sync_status=failed&syncable_only=1&bmpa_failed_only=1&page=2&back=/admin'); $res->assertOk(); $html = (string) $res->getContent(); $this->assertStringContainsString('data-role="batch-bmpa-blocked-hint"', $html); - $this->assertStringContainsString('切到可BMPA处理集合', $html); - $this->assertStringContainsString('status=pending', $html); - $this->assertStringContainsString('payment_status=unpaid', $html); + $this->assertMatchesRegularExpression('/href="([^"]+)"[^>]*>切到可BMPA处理集合<\/a>/', $html); + + preg_match('/href="([^"]+)"[^>]*>切到可BMPA处理集合<\/a>/', $html, $m); + $href = html_entity_decode((string) ($m[1] ?? '')); + + $query = parse_url($href, PHP_URL_QUERY) ?: ''; + parse_str($query, $q); + + $this->assertSame('1', (string) ($q['bmpa_processable_only'] ?? '')); + $this->assertSame('/admin', (string) ($q['back'] ?? '')); + $this->assertArrayNotHasKey('page', $q); + $this->assertArrayNotHasKey('bmpa_failed_only', $q); + $this->assertArrayNotHasKey('sync_status', $q); + $this->assertArrayNotHasKey('syncable_only', $q); } }