phpunit-best-practices

PHPUnit testing best practices and conventions guide. This skill should be used when writing, reviewing, or refactoring PHPUnit tests to ensure consistent, maintainable, and effective test suites. Triggers on tasks involving test creation, test refactoring, test configuration, code coverage, data providers, mocking, or PHPUnit XML configuration.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "phpunit-best-practices" with this command: npx skills add pentiminax/phpunit-best-practices/pentiminax-phpunit-best-practices-phpunit-best-practices

PHPUnit Best Practices

Comprehensive testing best practices guide for PHPUnit applications, maintained by pentiminax. Contains 40 rules across 8 categories, prioritized by impact to guide automated test generation, refactoring, and code review.

When to Apply

Reference these guidelines when:

  • Writing new PHPUnit test classes or test methods
  • Reviewing test code for quality and consistency
  • Refactoring existing test suites
  • Configuring PHPUnit XML settings
  • Setting up code coverage and test organization

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Principles & PatternsCRITICALprinciple-
2Coding StandardsCRITICALstandard-
3Test AttributesHIGHattr-
4Data ManagementHIGHdata-
5Test DocumentationMEDIUMdoc-
6MockingMEDIUMmock-
7Integration TestingMEDIUMintegration-
8ConfigurationLOW-MEDIUMconfig-

Quick Reference

1. Principles & Patterns (CRITICAL)

2. Coding Standards (CRITICAL)

3. Test Attributes (HIGH)

4. Data Management (HIGH)

5. Test Documentation (MEDIUM)

6. Mocking (MEDIUM)

7. Integration Testing (MEDIUM)

8. Configuration (LOW-MEDIUM)

How to Use

Read individual rule files for detailed explanations and code examples:

Each rule file contains:

  • Brief explanation of why it matters
  • Incorrect code example with explanation
  • Correct code example with explanation
  • Additional context and references

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

Claw Insights Install

Install and run Claw Insights, a read-only observability dashboard that monitors your OpenClaw agent with zero intrusion — no code changes, no cloud dependen...

Registry SourceRecently Updated
Coding

QR Campaign Studio

Generate marketing QR codes with batch output, UTM tracking links, logo embedding, and poster composition. Use when users ask 生成二维码/批量二维码/渠道追踪码/带logo二维码. Sup...

Registry SourceRecently Updated
Coding

Seerr server manager

CLI for the Seerr media request management API. Search movies and TV shows, create and manage media requests, manage users, track issues, and administer a se...

Registry SourceRecently Updated
Coding

AI Corporate Training Video Factory — Build a Complete Employee Training Program in 2 Hours

Automates creation of complete corporate training programs with up-to-date curricula, professional videos, assessments, and automated employee delivery in 2...

Registry SourceRecently Updated