From 0c3c5abc14ce57065e9d73f63ef567faf8f222a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Wed, 18 Mar 2026 20:05:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95:=20=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E7=94=9F=E6=95=88=E9=98=BB=E6=96=AD=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E8=AF=AD=E4=B9=89=E6=8A=A4=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ckedHintShouldIncludeGoPendingLinkTest.php | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/tests/Feature/AdminPlatformOrderIndexBatchMarkActivatedBlockedHintShouldIncludeGoPendingLinkTest.php b/tests/Feature/AdminPlatformOrderIndexBatchMarkActivatedBlockedHintShouldIncludeGoPendingLinkTest.php index f19d7d8..f6f34d2 100644 --- a/tests/Feature/AdminPlatformOrderIndexBatchMarkActivatedBlockedHintShouldIncludeGoPendingLinkTest.php +++ b/tests/Feature/AdminPlatformOrderIndexBatchMarkActivatedBlockedHintShouldIncludeGoPendingLinkTest.php @@ -23,16 +23,27 @@ class AdminPlatformOrderIndexBatchMarkActivatedBlockedHintShouldIncludeGoPending { $this->loginAsPlatformAdmin(); - // 构造一个会触发 batch_mark_activated 被阻断的筛选:缺少 sync_status=unsynced。 - $res = $this->get('/admin/platform-orders?payment_status=paid&status=pending'); + // 构造一个会触发 batch_mark_activated 被阻断的复杂筛选; + // blocked hint 应给出“切到待生效集合”入口,并清理冲突开关。 + $res = $this->get('/admin/platform-orders?payment_status=paid&status=pending&sync_status=failed&bmpa_failed_only=1&page=2&back=/admin'); $res->assertOk(); $html = (string) $res->getContent(); $this->assertStringContainsString('data-role="batch-mark-activated-blocked-hint"', $html); - $this->assertStringContainsString('切到待生效集合', $html); - $this->assertStringContainsString('payment_status=paid', $html); - $this->assertStringContainsString('status=pending', $html); - $this->assertStringContainsString('sync_status=unsynced', $html); + $this->assertMatchesRegularExpression('/href="([^"]+)"[^>]*>切到待生效集合<\/a>/', $html); + + preg_match('/href="([^"]+)"[^>]*>切到待生效集合<\/a>/', $html, $m); + $href = html_entity_decode((string) ($m[1] ?? '')); + + $query = parse_url($href, PHP_URL_QUERY) ?: ''; + parse_str($query, $q); + + $this->assertSame('paid', (string) ($q['payment_status'] ?? '')); + $this->assertSame('pending', (string) ($q['status'] ?? '')); + $this->assertSame('unsynced', (string) ($q['sync_status'] ?? '')); + $this->assertSame('/admin', (string) ($q['back'] ?? '')); + $this->assertArrayNotHasKey('page', $q); + $this->assertArrayNotHasKey('bmpa_failed_only', $q); } }