News

Create Test Files With Artisan Make Commands Automatically

Published
Create Test Files With Artisan Make Commands Automatically image

The Laravel make-testable package creates a test along with any class created using php artisan make:* commands. After installing this package a development dependency, you can use it by adding the --test flag to make commands:

# Before
php artisan make:model Blog
php artisan make:test Models\BlogTest --unit
 
# After
php artisan make:model Blog --test

This package supports the following commands:

  • Command
  • Controller
  • Event
  • Job
  • Listener
  • Middleware
  • Model
  • Notification

You can learn more about this package, get full installation instructions, and view the source code on GitHub at iaK/make-testable.


This package was submitted to our Laravel News Links section. Links is a place the community can post packages and tutorials around the Laravel ecosystem. Follow along on Twitter @LaravelLinks

Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Filed in

Sponsored

masteringlaravel logo
Laravel Code Review

Get expert guidance in a few days with a Laravel code review

Visit Laravel Code Review

The latest

View all →
Agent Run Observability in Laravel AI SDK 0.11 image

Agent Run Observability in Laravel AI SDK 0.11

Read article
Debounced Queued Event Listeners in Laravel image

Debounced Queued Event Listeners in Laravel

Read article
Statamic Mailables Viewer Previews Laravel Emails in the Control Panel image

Statamic Mailables Viewer Previews Laravel Emails in the Control Panel

Read article
Laravel Tackle: Run an AI Coding Agent in Your Laravel App image

Laravel Tackle: Run an AI Coding Agent in Your Laravel App

Read article
Queue::forward(): Reroute Laravel Queues in One Place image

Queue::forward(): Reroute Laravel Queues in One Place

Read article
Laravel Read-Through Filesystem: Lazy Storage Migration image

Laravel Read-Through Filesystem: Lazy Storage Migration

Read article