-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #2676 : add ability to test redirect()->route() via ControllerTester #2686
Conversation
I've added unit test for it. |
It seems this method only check routes in |
I got the solution for autoload in test, specifically the router, doesn't detect I register "App" and "Config" to |
travis build on php72:postgres is unrelated with it. |
I found a better solution. Instead of add the autoloader, I added a 1 line after setup routes, which is a require_once of $routes = \Config\Services::routes();
$routes->getRoutes('*');
require_once APPPATH . 'Config/Routes.php'; That's it! So developer don't need to update their composer.json. |
ready for review. travis build php73:mysqli is unrelated. |
actually, the require_once APPPATH . 'Config/Routes.php';
$routes->getRoutes('*'); |
travis build green 🎉 |
This looks good and well written. I would like to test it with a couple existing projects and modules to make sure loading the routes that early doesn't effect other services, like mocking. |
@MGatner merge-able ? |
I still haven't tried it! Let me do a couple right now. |
Okay, looks good! Tested two projects and two modules and this change didn't seem to affect them. |
@samsonasik Thanks for the ping BTW. I've got a ton going on and the repo has been quite busy. If you see other things that merit my attention don't hesitate to mention me. |
Fixes #2676 to add ability to test redirect()->route() in test bootstrap so the existing route both in
app
andtests
will be discovered.Checklist: