From 47f1ee9301bb098496923ab12bdf03d273417acb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Thu, 19 Mar 2026 03:35:10 +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=E5=B7=B2=E4=BB=98=E6=97=A0=E5=9B=9E?= =?UTF-8?q?=E6=89=A7=E8=87=AA=E4=B8=80=E8=87=B4=E6=8A=A4=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...LinkShouldStayOnPaidNoReceiptScopeTest.php | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tests/Feature/AdminPlatformOrderFiltersReceiptStatusHintLinkShouldStayOnPaidNoReceiptScopeTest.php diff --git a/tests/Feature/AdminPlatformOrderFiltersReceiptStatusHintLinkShouldStayOnPaidNoReceiptScopeTest.php b/tests/Feature/AdminPlatformOrderFiltersReceiptStatusHintLinkShouldStayOnPaidNoReceiptScopeTest.php new file mode 100644 index 0000000..61e9ba9 --- /dev/null +++ b/tests/Feature/AdminPlatformOrderFiltersReceiptStatusHintLinkShouldStayOnPaidNoReceiptScopeTest.php @@ -0,0 +1,48 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_receipt_status_hint_link_should_stay_on_paid_no_receipt_scope_when_already_there(): void + { + $this->loginAsPlatformAdmin(); + + $res = $this->get('/admin/platform-orders?' . Arr::query([ + 'payment_status' => 'paid', + 'receipt_status' => 'none', + 'merchant_id' => 2, + 'plan_id' => 3, + '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, $m); + $href = html_entity_decode($m[1] ?? ''); + $query = parse_url($href, PHP_URL_QUERY) ?: ''; + parse_str($query, $q); + + $this->assertSame('paid', (string) ($q['payment_status'] ?? '')); + $this->assertSame('none', (string) ($q['receipt_status'] ?? '')); + $this->assertSame('2', (string) ($q['merchant_id'] ?? '')); + $this->assertSame('3', (string) ($q['plan_id'] ?? '')); + $this->assertSame('/admin/plans', (string) ($q['back'] ?? '')); + } +}