Support the ongoing development of Laravel.io →
posted 8 years ago
Testing
Last updated 2 years ago.
0

have you considered caching the routes ? php artisan route:cache https://laravel.com/docs/5.0/controllers#route-caching

0

Tried caching the routes, the memory usage is still the same.

0

You could break them up, putting related routes together in separate files and then dynamically include needed route files.

0

yes that would be your next solution. but if this happens only when you test i don't think it's much of a problem since you're running unit tests only once per test session.

0

I'm currently trying the approach with loading the routes dynamically like that (in routes.php):

if (Request::is('module/*') {
    Route::group(...);
}

It works in the browser, however, when I try to test the routes, phpunit doesn't find them. In TestCase.php there is a createApplication() method, and in it:

$app->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap();

which loads the routes.php file without any request, so the specific routes don't load.

Last updated 8 years ago.
0

I'm having a very similar problem. Did you ever figure out a solution?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.