From 24f3bd7e299b8178d95c81ce1b5fc1237d205b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Wed, 18 Mar 2026 22:24:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=BC=BA=E8=AE=A2=E9=98=85=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=B7=B2=E4=BB=98=E6=97=A0=E5=9B=9E=E6=89=A7=E5=BF=AB?= =?UTF-8?q?=E6=8D=B7=E7=AD=9B=E9=80=89=E5=8F=A3=E5=BE=84=E6=8A=A4=E6=A0=8F?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ShouldUseSubscriptionIndexSelfBackTest.php | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 tests/Feature/AdminSiteSubscriptionIndexPaidNoReceiptQuickFilterShouldUseSubscriptionIndexSelfBackTest.php diff --git a/tests/Feature/AdminSiteSubscriptionIndexPaidNoReceiptQuickFilterShouldUseSubscriptionIndexSelfBackTest.php b/tests/Feature/AdminSiteSubscriptionIndexPaidNoReceiptQuickFilterShouldUseSubscriptionIndexSelfBackTest.php new file mode 100644 index 0000000..b5514d1 --- /dev/null +++ b/tests/Feature/AdminSiteSubscriptionIndexPaidNoReceiptQuickFilterShouldUseSubscriptionIndexSelfBackTest.php @@ -0,0 +1,50 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_paid_no_receipt_quick_filter_should_keep_safe_back_context_like_other_quick_filters(): void + { + $this->loginAsPlatformAdmin(); + + $res = $this->get('/admin/site-subscriptions?' . Arr::query([ + 'merchant_id' => 2, + 'plan_id' => 3, + 'keyword' => 'alpha', + 'back' => '/admin/platform-orders?payment_status=paid', + ])); + $res->assertOk(); + + $html = (string) $res->getContent(); + $matched = preg_match('/]+href="([^"]+)"[^>]*>\s*已付无回执\s*<\/a>/u', $html, $m); + $this->assertSame(1, $matched, '未找到订阅列表页“已付无回执”快捷筛选'); + + $href = html_entity_decode($m[1] ?? ''); + $parts = parse_url($href); + parse_str($parts['query'] ?? '', $q); + + $this->assertSame('2', (string) ($q['merchant_id'] ?? '')); + $this->assertSame('3', (string) ($q['plan_id'] ?? '')); + $this->assertSame('alpha', (string) ($q['keyword'] ?? '')); + $this->assertSame('paid', (string) ($q['payment_status'] ?? '')); + $this->assertSame('none', (string) ($q['receipt_status'] ?? '')); + $this->assertSame('/admin/platform-orders?payment_status=paid', (string) ($q['back'] ?? '')); + } +}