ludo237
236
3
Testing

Middleware Throwing Exception when testing controllers

Posted 3 years ago by ludo237

Hello everyone.

I'm trying to test an AuthController, in particular the registration method which is linked to a view that has a reCaptcha on it.

At the moment I can't pass the test because the formRequest of the registration method requires the reCaptcha in order to pass, how can I skip that?

I've thought about using withoutMiddleware but when I try to run the same test using that method the result is the following

Caused by
RuntimeException: Session store not set on request. in /home/vagrant/Application/vendor/laravel/framework/src/Illuminate/Http/Request.php:852

For the sake of checking I've try to run the registration manually and it works, the problem is not linked to the implementation of the registration method inside AuthController.

How can I test a Controller without interact with the formRequest?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.