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); } }