I am using Laravel 5.4 with Homestead vagrant and running my app on vagrant where i run tests like vagrant@homestead:~/ticketApp$ php artisan dusk
and it works fine.
currently i need to apply a hack where i put a check in my code that
if ('cli' === PHP_SAPI) {
// do something
}
and run the command php php artisan dusk
but the condition 'cli' === PHP_SAPI
didn't return true
and when i print the PHP_SAPI
it returns the fpm-cgi
.
whereas i was expecting that PHP_SAPI
will return cli
.
Please help how i'll run my tests to make this condition true