Skip to content

Instantly share code, notes, and snippets.

@jasonmccreary
Last active July 23, 2019 07:10
Show Gist options
  • Save jasonmccreary/04ca75524003277b8ef175b0d8e2d2f8 to your computer and use it in GitHub Desktop.
Save jasonmccreary/04ca75524003277b8ef175b0d8e2d2f8 to your computer and use it in GitHub Desktop.
One-line shell script to generate HTTP Tests for your application's controllers.
# Run `artisan make:test` for all Controllers under `your app/Http/Controllers` folder.
# Created tests mirror their path under the `app` folder and are suffixed with "Test".
find app/Http/Controllers -type f -name '*Controller.php' -exec sh -c 'php artisan make:test $(dirname "${1:4}")/$(basename "$1" .php)Test' sh {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment