skip to Main Content

Detecting when Laravel Dusk is running

Often in Laravel I need to detect the environment to avoid triggering certain code while running tests, like logging or sending an email: if (!app()->environment("testing")) { Mail::to($email)->queue(new WelcomeEmail($transaction->id)); } This works fine when the environment is set to testing in…

VIEW QUESTION

Laravel Dusk says Class 'TestsBrowserComponents…' could not be found

After I installed laravel-dusk following the official Laravel documentation and run this command: php artisan make:component CardComponentTest Then try to run immediately: php artisan dusk tests/Browser/Components/CardComponentTest.php I get this error: Class 'TestsBrowserComponentsCardComponentTest' could not be found in '/var/www/html/tests/Browser/Components/CardComponentTest.php'. I tested…

VIEW QUESTION
Back To Top
Search