From 4d1b19b29586eb190bc1be5eeca49e1f65da11a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Wed, 18 Mar 2026 20:03:37 +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=E5=90=8C=E6=AD=A5=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 --- ...kedHintShouldIncludeGoSyncableLinkTest.php | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/tests/Feature/AdminPlatformOrderIndexBatchActivateBlockedHintShouldIncludeGoSyncableLinkTest.php b/tests/Feature/AdminPlatformOrderIndexBatchActivateBlockedHintShouldIncludeGoSyncableLinkTest.php index 4bcc9c8..9ef1b16 100644 --- a/tests/Feature/AdminPlatformOrderIndexBatchActivateBlockedHintShouldIncludeGoSyncableLinkTest.php +++ b/tests/Feature/AdminPlatformOrderIndexBatchActivateBlockedHintShouldIncludeGoSyncableLinkTest.php @@ -23,15 +23,27 @@ class AdminPlatformOrderIndexBatchActivateBlockedHintShouldIncludeGoSyncableLink { $this->loginAsPlatformAdmin(); - // 构造一个会触发 batch_activate_subscriptions 被阻断的筛选:未勾选 syncable_only。 - $res = $this->get('/admin/platform-orders'); + // 构造一个会触发 batch_activate_subscriptions 被阻断的复杂筛选; + // blocked hint 应给出“切到可同步订阅集合”入口,并清理冲突开关。 + $res = $this->get('/admin/platform-orders?sync_status=failed&bmpa_failed_only=1&synced_only=1&page=2&back=/admin'); $res->assertOk(); $html = (string) $res->getContent(); $this->assertStringContainsString('data-role="batch-activate-subscriptions-blocked-hint"', $html); - $this->assertStringContainsString('切到可同步订阅集合', $html); - $this->assertStringContainsString('syncable_only=1', $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('1', (string) ($q['syncable_only'] ?? '')); + $this->assertSame('unsynced', (string) ($q['sync_status'] ?? '')); + $this->assertSame('/admin', (string) ($q['back'] ?? '')); + $this->assertArrayNotHasKey('page', $q); + $this->assertArrayNotHasKey('bmpa_failed_only', $q); + $this->assertArrayNotHasKey('synced_only', $q); } }