LearningLaravelYai's avatar

Detect that laravel is running test in controllers?

Hi, when laravel run tests, both unit test and feature tests, does is sets any global variables, that I can detect other places in the application?

I'm not interested in the .env trick. But would like to know if there are other ways to detect, that the application is in test mode?

Currently I think of setting a global variable in my test.. but maybe there is already something?

It's in my controller, that I would like to detect, that a test is running! ? :-)

Thanks

0 likes
1 reply

Please or to participate in this conversation.