joshmoreno / sanctum-auth-tests
Laravel Sanctum 的身份验证测试
v1.0.0
2020-04-24 01:43 UTC
Requires
- illuminate/support: ^6.9|^7.0
- laravel/sanctum: ^2.0.0
This package is auto-updated.
Last update: 2024-09-24 16:55:54 UTC
README
这是为 sanctum ^2.0.0
定制的。按照常规遵循他们的 文档。
快速提示,这些测试的所有权属于您。您可以随意编辑它们。添加更多测试、删除、重构……无论您觉得合适。安装后,您可自由移除此包!
安装
composer require joshmoreno/sanctum-auth-tests php artisan sanctumAuthTests:publish # same thing as # php artisan vendor:publish --provider="JoshMoreno\SanctumAuthTests\SanctumAuthTestsServiceProvider" --tag="tests" # you got what you came for, no need to keep the package around. Bye 👋 composer remove joshmoreno/sanctum-auth-tests
自定义
提醒,发布后,您可自由处理这些测试。
默认情况下,测试假设您正在使用以下典型的 Laravel 身份验证路由
- 登录 -
route('login')
- 注销 -
route('logout')
- 注册 -
route('register')
- 重新发送验证邮件 -
route('verification.resend')
- 验证邮件 -
verification.verify // 未在 Laravel 中命名 ☹️
- 忘记密码 -
route('password.email')
- 更新密码 -
route('password.update')
您可以在 tests/Feature/ApiAuth/ApiAuthTestCase.php
中找到所有这些和更多内容。