diff --git a/tests/Feature/AdminPlatformOrderFormBackLinkNotEscapedTest.php b/tests/Feature/AdminPlatformOrderFormBackLinkNotEscapedTest.php new file mode 100644 index 0000000..a55a01c --- /dev/null +++ b/tests/Feature/AdminPlatformOrderFormBackLinkNotEscapedTest.php @@ -0,0 +1,35 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_create_form_back_link_should_not_escape_ampersand(): void + { + $this->loginAsPlatformAdmin(); + + $back = '/admin/site-subscriptions?status=activated&keyword=test'; + + $res = $this->get('/admin/platform-orders/create?back=' . urlencode($back)); + $res->assertOk(); + + $res->assertSee('返回(保留上下文)'); + $res->assertSee('href="' . $back . '"', false); + $res->assertDontSee('href="' . str_replace('&', '&', $back) . '"', false); + } +}