studio icon indicating copy to clipboard operation
studio copied to clipboard

Middleware not being tested

Open michaellindahl opened this issue 6 years ago • 0 comments

I found that I had an error in my middleware but this was not caught by the tests. It looks like the tests do not run the middleware. This would be great feature to add.

Steps to repro:

  1. Install Botman Studios
  2. Add Middleware with die(); in methods.

Expectation: Tests will fail and Botman Tinker will not respond.

Actual: Tests pass and Botman Tinker does not respond.

Temporary Solution: Mirror the middleware statements in BotManController to the test's CreatesApplication.php.

Proposed solution: I believe an ideal solution might be to have the BotManServiceProvider register the middleware and botman route from the specification of the botman config. This would remove the handle method from BotManController so that this controller is no longer required. Is there other logic that others might be using handle for that would need to be accounted for in this refactor?

michaellindahl avatar Oct 20 '19 05:10 michaellindahl