Laravel11
修正した箇所だけを実行したいときに!
とあるテストクラスの、1つのテスト関数を実行する方法
# php artisan test --filter testStore tests/Feature/UserControllerTest.php
PASS Tests\Feature\UserControllerTest
✓ store 62.42s
Tests: 1 passed (4 assertions)
Duration: 62.53s
とあるテストクラスだけを実行
# php artisan test --filter UserControllerTest
PASS Tests\Feature\UserControllerTest
✓ index 65.72s
✓ store 0.77s
✓ show 0.68s
✓ resend 0.60s
Tests: 4 passed (19 assertions)
Duration: 68.22s
同じ名前のテスト関数をクラスをまたいで実行
# php artisan test --filter testIndex
PASS Tests\Feature\CareerControllerTest
✓ index 63.48s
PASS Tests\Feature\CompanyUserControllerTest
✓ index 0.64s
PASS Tests\Feature\InvitationControllerTest
✓ index 0.48s
PASS Tests\Feature\QualificationControllerTest
✓ index 0.52s
PASS Tests\Feature\SkillSheetListControllerTest
✓ index 0.56s
PASS Tests\Feature\SkillSheetListSentHistoryControllerTest
✓ index 0.50s
PASS Tests\Feature\SkillSheetSentHistoryControllerTest
✓ index 0.47s
PASS Tests\Feature\ViewableSkillSheetControllerTest
✓ index 0.52s
PASS Tests\Feature\WriteHistoryControllerTest
✓ index 0.49s
Tests: 9 passed (27 assertions)
Duration: 68.14s