在运行phpunit
时,来自身份验证和CSRF的错误是很常见的。
在我们使用的TestCase中:
use WithoutMiddleware;
问题是,当表单失败时,它通常会返回一条Flash消息和旧输入。我们已经禁用了所有中间件,所以我们无法访问Input::old('username');
或flash消息。
此外,我们对这个失败的表单post的测试返回:
Caused by
exception 'RuntimeException' with message 'Session store not set on request.
有没有一种方法可以启用会话中间件并禁用其他所有功能。
https://stackoverflow.com/questions/34357350
复制相似问题