From a8663c48abbea996815e6ca89389494533e02ec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Thu, 19 Mar 2026 03:29:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=BC=BA=E5=9B=9E=E6=89=A7=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E8=AF=B4=E6=98=8E=E9=93=BE=E6=8E=A5=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E6=8A=A4=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...eceiptStatusHintLinkShouldDropPageTest.php | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 tests/Feature/AdminPlatformOrderFiltersReceiptStatusHintLinkShouldDropPageTest.php diff --git a/tests/Feature/AdminPlatformOrderFiltersReceiptStatusHintLinkShouldDropPageTest.php b/tests/Feature/AdminPlatformOrderFiltersReceiptStatusHintLinkShouldDropPageTest.php new file mode 100644 index 0000000..2c4c94b --- /dev/null +++ b/tests/Feature/AdminPlatformOrderFiltersReceiptStatusHintLinkShouldDropPageTest.php @@ -0,0 +1,46 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_receipt_status_hint_link_should_drop_page_query(): void + { + $this->loginAsPlatformAdmin(); + + $res = $this->get('/admin/platform-orders?' . Arr::query([ + 'merchant_id' => 2, + 'plan_id' => 3, + 'keyword' => 'alpha', + 'back' => '/admin/plans', + 'page' => 5, + ])); + $res->assertOk(); + + $html = (string) $res->getContent(); + preg_match('/data-role="po-receipt-status-broad-none-go-paid-no-receipt"[^>]*href="([^"]+)"/u', $html, $m); + $href = html_entity_decode($m[1] ?? ''); + $query = parse_url($href, PHP_URL_QUERY) ?: ''; + parse_str($query, $q); + + $this->assertArrayNotHasKey('page', $q); + $this->assertSame('paid', (string) ($q['payment_status'] ?? '')); + $this->assertSame('none', (string) ($q['receipt_status'] ?? '')); + } +}