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
phpunit does not trigger Application::routes() #13317
Comments
use like this public function setUp()
{
parent::setUp();
$this->useHttpServer(true); <-- add this line
} this requires in cake 3.x series ,cake 4 uses the |
I have added |
I also just noticed that all my |
How can someone reproduce this problem? My applications get their bootstrap() and routes() hooks called when the test case enables |
@asgraf Can you provide more information on your application setup? |
Closing as the issue has gone stale and there hasn't been any follow up in a long time. |
The hooks are called but it will first try to run the |
@vladbanyai-spearline Thanks for the extra context, but I don't know how that helps me understand how to reproduce this issue. Do you have an example application that contains the error you're facing? I'm looking for some code that exhibits the problem so that I can debug what is going on and why the applications I work on behave differently and don't suffer from this problem. |
@vladbanyai-spearline Can you help us reproduce it? |
Closing again due to no response. |
This is a (multiple allowed):
bug
enhancement
feature-discussion (RFC)
CakePHP Version: 3.7.8
Platform and Target: PHP 5.6.40 on Mageia Linux 6.1 (x64)
What you did
in src/Application.php
in config/routes.php
Then called from console:
./vendor/bin/phpunit
What happened
Every test fails with following error:
I have added xdebug_print_function_stack() to my routes.php to trace how this occurs.
Here is interesting part:
Looks like
routes.php
is included internally viaRouter::_loadRoutes()
andApplication::routes()
is never calledMoving registerMiddleware call from
Application::routes()
method intoroutes.php
file seem to fix problem for meWhat you expected to happen
Tests should use Application::routes()
The text was updated successfully, but these errors were encountered: