botman / botman/studio

Middleware not being tested

Open
#87 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
332
Forks
91
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.