From d7bb750eef9e7f42ca41e56f969309ad914d1ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Thu, 19 Mar 2026 03:23:42 +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=E4=B8=8E=E5=BF=AB=E6=8D=B7=E5=85=A5?= =?UTF-8?q?=E5=8F=A3=E4=B8=80=E8=87=B4=E6=80=A7=E6=8A=A4=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...houldMatchPaidNoReceiptQuickFilterTest.php | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 tests/Feature/AdminPlatformOrderFiltersReceiptStatusHintLinkShouldMatchPaidNoReceiptQuickFilterTest.php diff --git a/tests/Feature/AdminPlatformOrderFiltersReceiptStatusHintLinkShouldMatchPaidNoReceiptQuickFilterTest.php b/tests/Feature/AdminPlatformOrderFiltersReceiptStatusHintLinkShouldMatchPaidNoReceiptQuickFilterTest.php new file mode 100644 index 0000000..555b3ec --- /dev/null +++ b/tests/Feature/AdminPlatformOrderFiltersReceiptStatusHintLinkShouldMatchPaidNoReceiptQuickFilterTest.php @@ -0,0 +1,54 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_receipt_status_hint_link_should_match_paid_no_receipt_quick_filter_scope(): void + { + $this->loginAsPlatformAdmin(); + + $res = $this->get('/admin/platform-orders?' . Arr::query([ + 'merchant_id' => 2, + 'plan_id' => 3, + 'keyword' => 'alpha', + 'back' => '/admin/plans', + ])); + $res->assertOk(); + + $html = (string) $res->getContent(); + + preg_match('/data-role="po-receipt-status-broad-none-go-paid-no-receipt"[^>]*href="([^"]+)"/u', $html, $m1); + preg_match('/data-role="po-quickfilter-paid-no-receipt"[^>]*href="([^"]+)"/u', $html, $m2); + + $this->assertNotEmpty($m1[1] ?? ''); + $this->assertNotEmpty($m2[1] ?? ''); + + $hintHref = html_entity_decode($m1[1]); + $quickHref = html_entity_decode($m2[1]); + + $hintQuery = parse_url($hintHref, PHP_URL_QUERY) ?: ''; + $quickQuery = parse_url($quickHref, PHP_URL_QUERY) ?: ''; + + parse_str($hintQuery, $hint); + parse_str($quickQuery, $quick); + + $this->assertSame($quick, $hint); + } +}