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

Found the solution: I forgot to add the Laravel4 module in my config file. I thought this was not necessary because I figured acceptance tests did not require any Laravel-specific methods, but it turns out all the correct variables for unit testing are also set by this module.

Once I included it, all tests wre running just fine. Hope this helps someone in the future

Last updated 2 years ago.
0

Does this work for your acceptance tests though? If Laravel is running in "testing" environment, it disables route filters...?

Last updated 2 years ago.
0

Same here but with Behat. Anybody knows how to solve?

Last updated 2 years ago.
0

@TheShiftExchange - A common path I follow for acceptance (where tests might test with a browser or a headless browser like phantomjs) is to have an "acceptance" environment and a host (e.g. if the dev site is on local.something, I create an acceptance.something) and pass an anonymous function to detect environment in laravel in order to check (instead of the default way with machine name) with either a logic to check for the different url or with environment variables on the server configuration (apache or nginx).

With homestead, I've automated that process by adding a third option to Homestead.yml (called env) and changing a bit serve.sh and homestead.sh to pick this up and set it in nginx configuration as an environment param.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

elimentz elimentz Joined 5 Mar 2014

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.