add-tests

Scaffold PHPUnit tests for a Bespoke package with Testbench integration.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/bespoke-uk/bespoke-mono --skill add-tests-bespoke-uk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-tests
Source: https://github.com/bespoke-uk/bespoke-mono/tree/main/.claude/skills/add-tests
Command: npx skills add https://github.com/bespoke-uk/bespoke-mono --skill add-tests-bespoke-uk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Scaffold comprehensive PHPUnit tests for a Bespoke package, saving time on setup and ensuring consistent test architecture.

Core Features & Use Cases

  • Base Test Infrastructure: tests/TestCase.php and tests/ExampleTest.php
  • Unit Tests: tests/Unit/Models/{Model}Test.php, tests/Unit/Actions/Create{Model}Test.php
  • Feature Tests: tests/Feature/Api/{Model}ApiTest.php, tests/Feature/Admin/{Model}ControllerTest.php
  • Livewire Tests: tests/Livewire/{Component}Test.php (if components exist)

Quick Start

Run the add-tests skill with the target package path to generate a complete PHPUnit test scaffold.

Frequently Asked Questions about add-tests

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

FAQPage Schema
How do I scaffold PHPUnit tests for a Laravel package?

To scaffold PHPUnit tests for a package, you can generate a standardized test suite structure including Unit, Feature, and base test files with Orchestra Testbench integration. This creates the necessary tests/ directories and a base TestCase automatically.

What is the best way to set up Orchestra Testbench integration for package testing?

The best way to set up Orchestra Testbench integration is by generating a base TestCase file that bootstraps the testing environment. This scaffolding provides a standardized base TestCase.php to handle package-specific testing configurations automatically.

How do I generate Livewire component tests for my package?

You can generate Livewire component tests by scaffolding the test suite structure. If Livewire components exist in your package, the scaffolding automatically creates specific test files under the tests/Livewire directory to validate component behavior.

Does this PHPUnit test scaffolding work for both API and Admin controller feature tests?

Yes, the PHPUnit test scaffolding generates feature tests for both API and Admin controllers. It creates distinct test files under tests/Feature/Api and tests/Feature/Admin directories to ensure comprehensive endpoint and controller coverage.

Can I automatically create unit tests for models and actions in my package?

Yes, you can automatically create unit tests for models and actions. The scaffolding generates specific test files under tests/Unit/Models and tests/Unit/Actions, providing a consistent architecture to verify model behavior and action execution.