LaravelでphpUnitを実行しようとしたところ「No tests executed!」のエラーが発生した。
公式ドキュメントのartisanコマンドを使用する方法も試したが、同様のエラーが発生。
実行コマンド
vendor/bin/phpunit
php artisan test
実行結果
artisanの場合
No tests executed!
原因
vondor/bin/phpunit --help
で確認したところ、テスト対象のファイルまたはディレクトリの引数が必須とのこと。
引数が不足していたので、エラーが発生した。
解決方法
対象のディレクトリを引数に渡せばOK
実行コマンド
vendor/bin/phpunit tests
artisanの場合
php artisan test tests