php-testing_skill

This skill helps you master PHP testing with PHPUnit 11 and Pest 3, covering TDD, mocking, and CI/CD integration.
  • Python

2

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill pluginagentmarketplace/custom-plugin-php --skill php-testing

  • SKILL.md6.3 KB

Overview

This skill teaches practical PHP testing mastery covering PHPUnit 11, Pest 3, TDD, mocking strategies, integration testing, and CI/CD pipelines. It focuses on actionable patterns, code examples, and configuration to help teams write reliable, fast, and maintainable tests. Use it to adopt test-driven workflows, reduce flakiness, and reach practical coverage goals.

How this skill works

The skill inspects your testing needs by topic (phpunit, pest, mocking, tdd, integration, ci-cd) and level (beginner, intermediate, advanced) to deliver focused guidance and examples. It provides module-based learning objectives, concrete code snippets (PHPUnit, Pest, Mockery), error codes and recovery steps, retry rules for transient failures, and CI/CD configurations for automated test runs. Recommendations map to common PHP frameworks (Laravel, Symfony) while remaining framework-agnostic by default.

When to use it

  • Adopting unit and integration testing for a new or existing PHP project
  • Migrating tests to PHPUnit 11 or Pest 3 and modern PHP attributes
  • Implementing TDD practices or training a team on test-first workflows
  • Introducing mocking and stubbing patterns to isolate components
  • Adding or improving CI/CD test pipelines with coverage and parallel runs

Best practices

  • Start small: write a failing test, implement minimal code, refactor (TDD loop)
  • Prefer clear test structure: setup, action, assertion; keep tests deterministic
  • Use mocks and spies to isolate external dependencies; avoid over-mocking core logic
  • Run tests in CI with consistent PHP versions and seeded environments; upload coverage artifacts
  • Measure and aim for meaningful coverage (target ≥80%) while prioritizing critical paths

Example use cases

  • Beginner module: learn PHPUnit test case structure and basic assertions for PHP 8.2+
  • Intermediate: use data providers, fixtures, and Mockery for repository/service tests
  • Advanced: enable parallel execution, coverage reporting, and mutation testing for confidence
  • Pest example: write expressive feature tests for user registration with database assertions
  • CI/CD: configure GitHub Actions to run tests, collect coverage, and fail fast on regressions

FAQ

Choose PHPUnit for extensive built-in features and ecosystem tools; choose Pest for succinct, expressive syntax layered on PHPUnit. Both work together and share runners and coverage tooling.

How do I reduce flaky tests in CI?

Isolate state, use database refresh traits or in-memory DBs, mock external services, add retries for transient external calls, and ensure identical PHP and dependency versions between local and CI.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
php-testing skill by pluginagentmarketplace/custom-plugin-php | VeilStrat