phpunit

A JAX / MLX library for transformer models that enables rapid prototyping and high-性能 kai'fa.

3|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/codebar-ag/coding-guidelines --skill phpunit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: phpunit
Source: https://github.com/codebar-ag/coding-guidelines/tree/main/resources/boost/skills/phpunit
Command: npx skills add https://github.com/codebar-ag/coding-guidelines --skill phpunit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Establishes a clear, consistent set of PHPUnit conventions for Laravel projects, helping teams write reliable, maintainable tests.

Core Features & Use Cases

  • Structure tests with Feature tests in tests/Feature and Unit tests in tests/Unit.
  • Feature tests should use RefreshDatabase when touching the database; Unit tests run without Laravel bootstrap.
  • Use test_ prefix with snake_case names and a void return type.
  • Prefer assertSame over assertEquals for strict type/value checks and assert specific values.
  • Every new model should have a corresponding factory in database/factories and tests should use factories instead of manual create/insert.
  • Use factories with states to cover variations and edge cases.

Quick Start

Run phpunit to execute your Laravel tests and verify feature, unit, and factory conventions.

Frequently Asked Questions about phpunit

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

FAQPage Schema
How do I structure PHPUnit tests for Laravel projects?

To structure PHPUnit tests for Laravel projects, place feature tests in the tests/Feature directory and unit tests in tests/Unit. This separation ensures feature tests bootstrap Laravel while unit tests run independently.

What is the best way to manage test data in Laravel PHPUnit tests?

The best way to manage test data in Laravel PHPUnit tests is using model factories. Every new model should have a corresponding factory in database/factories, utilizing factory states to cover data variations and edge cases.

When do I need RefreshDatabase in Laravel feature tests?

You need RefreshDatabase in Laravel feature tests whenever the test touches the database. This trait resets the database after each test, ensuring a clean state and preventing data bleeding between test runs.

Why should PHPUnit unit tests not use the Laravel bootstrap?

PHPUnit unit tests should not use the Laravel bootstrap to ensure they run in isolation. Testing pure logic without framework overhead keeps unit tests fast and verifies that the code does not rely on Laravel's service container.

How do I write PHPUnit test method names for Laravel?

To write PHPUnit test method names for Laravel, use the test_ prefix with snake_case and declare a void return type. This standardized convention ensures clarity and consistency across your testing suite.

Should I use assertSame or assertEquals in PHPUnit tests?

You should prefer assertSame over assertEquals in PHPUnit tests for strict type and value checks. Using assertSame ensures your explicit assertions match both the expected value and the exact data type.