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

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated