Laravel auth测试没有可探测的用户

发布于 2025-02-09 06:33:16 字数 259 浏览 2 评论 0原文

我是新手测试的新手,所以我想创建一个验证测试,但是在项目中,我不使用Laravel模型,但是由于很久以前的启动项目,我正在使用自己的Auth方法。 TestCase类具有Actingas方法,但我不使用它,因此我无法测试用户验证,甚至我不知道该如何测试面板?

我将用户电子邮件和密码与JSON发布,然后将用户重定向到AUTH页面。我只有laravel_session cookie。

我可以在Auth后使用Cookie进行测试吗?我如何访问cookie,我必须在标题中发送它?

I'm newbie on testing so I want to create a auth testing but in project I don't use laravel Models but I'm using own methods for auth because of started project too long ago. TestCase class has actingAs method but i don't use it so i can not test user auth and even more i don't know how can i test the panel ?

I post the user email and password with JSON and then user redirect to auth page. I have only laravel_session cookie.

Can I use the cookie for testing after auth ? How can I access the cookie and Do I have to send it with in header ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文