feature-test

Generate PHPUnit feature tests for Laravel API CRUD endpoints.

Updated Jul 18, 2022
One-click install
npx skills add https://github.com/milosptr/pos-system --skill feature-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: feature-test
Source: https://github.com/milosptr/pos-system/tree/main/.claude/skills/feature-test
Command: npx skills add https://github.com/milosptr/pos-system --skill feature-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Create PHPUnit feature tests for API endpoints following Laravel testing conventions to ensure controllers, responses, and database interactions behave as expected.

Core Features & Use Cases

  • Scaffold a feature test file in tests/Feature for a target model or API endpoint.
  • Provide standard CRUD test patterns (list, show, create, update, delete) with Factory-based data setups and RefreshDatabase usage.
  • Demonstrate integration with Laravel's testing utilities and a consistent test structure that can be extended for project-specific flows.

Quick Start

Create a new Feature test file under tests/Feature for your API endpoints following the standard Laravel testing conventions.

Frequently Asked Questions about feature-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold PHPUnit feature tests for Laravel API endpoints?

To scaffold PHPUnit feature tests for Laravel API endpoints, this tool automates the creation of test files in tests/Feature. It generates standard CRUD test patterns covering listing, showing, creating, updating, and deleting resources using model factories and RefreshDatabase.

Do I need model factories to generate Laravel API feature tests?

Yes, model factories are required to generate Laravel API feature tests. The scaffolding relies on factory-based data setups to populate the database for testing controllers, API responses, and database interactions across standard CRUD scenarios.

Can I use this to test Laravel controllers and database interactions?

You can use this to test Laravel controllers and database interactions. It applies PHPUnit feature tests to API endpoints, ensuring controllers, responses, and database interactions behave as expected following Laravel testing conventions.

What is the best way to generate CRUD test patterns for a Laravel API?

The best way to generate CRUD test patterns for a Laravel API is using an automated scaffolding tool. It creates a feature test file in tests/Feature with standard patterns for list, show, create, update, and delete operations.

Does this Laravel testing scaffolder require a specific testing environment?

This Laravel testing scaffolder requires a testing environment with Laravel, PHPUnit, and a phpunit.xml file configured. These prerequisites ensure the generated feature tests run correctly within the standard Laravel testing utilities.

Why does my generated Laravel feature test use RefreshDatabase?

Generated Laravel feature tests use RefreshDatabase to reset the database state after each test. This ensures factory-based data setups and database interactions remain isolated and predictable across CRUD test patterns.