From 7633083f6a27dbd1a4f13fab469f82425e349cb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Wed, 11 Mar 2026 04:53:21 +0000 Subject: [PATCH] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E8=AE=A2=E5=8D=95=E8=AF=A6?= =?UTF-8?q?=E6=83=85=EF=BC=9A=E9=80=80=E6=AC=BE=E4=B8=8D=E4=B8=80=E8=87=B4?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=B8=8E=E8=B7=B3=E8=BD=AC=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rderShowRefundInconsistentHintLinkTest.php | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 tests/Feature/AdminPlatformOrderShowRefundInconsistentHintLinkTest.php diff --git a/tests/Feature/AdminPlatformOrderShowRefundInconsistentHintLinkTest.php b/tests/Feature/AdminPlatformOrderShowRefundInconsistentHintLinkTest.php new file mode 100644 index 0000000..9aa8824 --- /dev/null +++ b/tests/Feature/AdminPlatformOrderShowRefundInconsistentHintLinkTest.php @@ -0,0 +1,72 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_show_page_will_show_refund_inconsistent_hint_and_link(): void + { + $this->loginAsPlatformAdmin(); + + $merchant = Merchant::query()->firstOrFail(); + $plan = Plan::query()->create([ + 'code' => 'refund_inconsistent_show_hint_01', + 'name' => '退款不一致详情提示测试', + 'billing_cycle' => 'monthly', + 'price' => 30, + 'list_price' => 30, + 'status' => 'active', + 'sort' => 10, + 'published_at' => now(), + ]); + + // 不一致:refunded 但退款总额不足 + $order = PlatformOrder::query()->create([ + 'merchant_id' => $merchant->id, + 'plan_id' => $plan->id, + 'order_no' => 'PO_REFUND_INCONS_SHOW_0001', + 'order_type' => 'new_purchase', + 'status' => 'activated', + 'payment_status' => 'refunded', + 'plan_name' => $plan->name, + 'billing_cycle' => $plan->billing_cycle, + 'period_months' => 1, + 'quantity' => 1, + 'payable_amount' => 30, + 'paid_amount' => 30, + 'placed_at' => now(), + 'paid_at' => now(), + 'activated_at' => now(), + 'refunded_at' => now(), + 'meta' => [ + 'refund_summary' => [ + 'count' => 1, + 'total_amount' => 10, + ], + ], + ]); + + $this->get('/admin/platform-orders/' . $order->id) + ->assertOk() + ->assertSee('疑似存在「退款状态 vs 退款总额」不一致') + ->assertSee('/admin/platform-orders?refund_inconsistent=1'); + } +}