php-testing

Automate PHPUnit and Pest testing patterns across PHP projects.

9|1|Updated Jun 16, 2026
One-click install
npx skills add https://github.com/AratKruglik/antigravity-sdlc --skill php-testing-aratkruglik
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php-testing
Source: https://github.com/AratKruglik/antigravity-sdlc/tree/main/plugins/php-foundation/skills/php-testing
Command: npx skills add https://github.com/AratKruglik/antigravity-sdlc --skill php-testing-aratkruglik

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PHP projects often struggle with inconsistent testing practices across unit and integration tests, leading to flaky results and hard-to-maintain test suites. This skill provides stack-agnostic PHPUnit and Pest patterns to establish a uniform testing approach, including test structure, data providers, mocks, fixtures, and coverage targets.

Core Features & Use Cases

  • Unified test patterns: Detects whether a project uses PHPUnit or Pest and applies the appropriate structure.
  • Data-driven testing: Encourages data providers and datasets to cover multiple scenarios with minimal duplication.
  • Test doubles discipline: Demonstrates proper use of mocks, stubs, and fakes to isolate the system under test.
  • Fixtures and setup: Provides guidance on setUp/tearDown and in-memory fixtures for reliable tests.
  • Quality goals: Aims for meaningful coverage targets and clean test organization across the codebase.

Quick Start

Create a test folder with a simple unit test using either PHPUnit or Pest and follow the Arrange-Act-Assert pattern to validate a small domain object.

Frequently Asked Questions about php-testing

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

FAQPage Schema
How do I standardize PHPUnit and Pest testing patterns across a PHP project?

To standardize PHPUnit and Pest testing patterns, you can apply framework-agnostic rules for test structure, naming conventions, data providers, mocks, and fixtures to establish uniform unit and integration testing practices across your PHP project.

What is the best way to organize mocks and fixtures in PHP unit tests?

The best way to organize mocks and fixtures in PHP unit tests is by using setUp/tearDown methods for in-memory fixtures and applying proper test doubles discipline to isolate the system under test reliably.

Can I use data providers for data-driven testing in both PHPUnit and Pest?

Yes, you can use data providers and datasets in both PHPUnit and Pest for data-driven testing, allowing you to cover multiple scenarios with minimal code duplication across your test suite.

Does this PHP testing approach work with any PHP framework or only specific ones?

This PHP testing approach is framework agnostic, meaning it works across any PHP codebase by detecting whether your project uses PHPUnit or Pest and applying the appropriate testing structure accordingly.

How do I start writing a PHP unit test using the Arrange-Act-Assert pattern?

To start writing a PHP unit test, create a test folder with a simple unit test using either PHPUnit or Pest, then follow the Arrange-Act-Assert pattern to validate a small domain object.