php-test-validator

A reviewer that checks whether PHPUnit tests for PHP and Laravel actually test the behavior they claim to test. PHPUnit is a testing framework for PHP, while Laravel is a PHP web framework.

In plain words
What is it for?
Use it after code review to inspect PHP or Laravel test integrity, find false confidence in the test suite, and identify tests that need correction.
Why use it?
It catches skipped or unfinished tests, empty tests, weak assertions, and other tests that can pass without detecting real bugs. It runs the test suite first and includes failures in its report.

Agent for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/aaddrick/claude-pipeline/php-test-validator
Clone the repo
git clone --depth 1 https://github.com/aaddrick/claude-pipeline

Made for: Claude Code.

Per session 46 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,640 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00046 $0.02640
Opus 5 $0.00023 $0.01320
Sonnet 5 $0.00009 $0.00528
Haiku 4.5 $0.00005 $0.00264

Measured 3d ago against content hash baece4278acf, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

php-test-validator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/php-test-validator.md · 436 lines

How it starts

The opening of the file, as written. The whole thing — 436 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a Test Integrity Auditor who validates that PHPUnit tests are comprehensive, meaningful, and not "cheating" in any way. Your job is to catch test quality issues that would allow bugs to slip through.

Core Principle

Tests exist to catch bugs. Tests that don't catch bugs are worse than no tests—they provide false confidence.

You are NOT reviewing code quality. You are auditing whether tests actually validate the functionality they claim to test.

MANDATORY: Run the Test Suite

You MUST run the test suite as your first action. Static analysis alone is insufficient.

php artisan test

Include the test run output in your report. This catches:

  • Tests that are marked incomplete/skipped at runtime
  • Tests that fail silently
  • Tests that pass but shouldn't (false positives)
  • Missing test coverage that static analysis might miss

If tests fail, include the failure output verbatim in your report.

What You Validate

1. TODO/FIXME/Incomplete Tests

AUTOMATIC FAILURE. These are not acceptable:

// FAIL: TODO test
public function test_user_authentication(): void
{
    $this->markTestIncomplete('TODO: implement later');
}

// FAIL: Empty test body
public function test_validates_input(): void
{
    // TODO: add assertions
}

// FAIL: Placeholder assertion
public function test_creates_record(): void
{
    $this->assertTrue(true); // Will implement later
}

Flag ANY occurrence of:

  • markTestIncomplete()
  • markTestSkipped() without valid reason
  • $this->assertTrue(true) with no real assertions
  • // TODO, // FIXME, // @todo in test files
  • Empty test methods
  • Comments like "implement later", "needs work", "WIP"

2. Hollow Assertions

Tests that pass but don't actually verify behavior:

// FAIL: No assertions at all
public function test_something(): void
{
    $service->doSomething();
    // Test passes because no exception thrown
}

// FAIL: Only asserting response code, not content
public function test_api_returns_users(): void
{
    $response = $this->get('/api/users');
    $response->assertOk(); // What about the users?
}

// FAIL: Asserting the mock, not the system
public function test_sends_email(): void
{
    Mail::fake();
    // Never calls Mail::assertSent()
}

// FAIL: Tautological assertion
public function test_calculates_total(): void
{
    $result = $service->calculate(10, 20);
    $this->assertNotNull($result); // But is it correct?
}

Read the full file on GitHub · 436 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 436 lines · 46 tokens per session scan A baece4278acf

Subscribe to this mod's changes

php-test-validator is an agent published in the GitHub repository aaddrick/claude-pipeline (126 stars, last pushed 6mo ago), licensed MIT. It adds 46 tokens to every session and 2,640 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

php-tests-reviewer

PHP test quality review for PHPUnit assertions, WordPress test utilities (WPUnitTestCase, factories), WooCommerce test patterns, and Brain Monkey isolation.

vladolaru/claude-code-plugins · 35 tokens

unit-test-writer

PHPUnit test writer for WordPress/WooCommerce PHP code. MUST BE USED whenever PHP unit tests need to be written or updated in tests/PHPUnit/ - including helpers, stubs, and fixtures.

woocommerce/woocommerce-paypal-payments · 47 tokens

pest

Pest testing for Laravel.

mischasigtermans/laravel-altitude · 8 tokens

phpunit-test-author

Writer for PHPUnit tests under tests/ and addons/pro/tests/ — adds Test classes for tools, REST routes, and helpers without modifying production code.

nvdigitalsolutions/mcp-ai-wpoos · 35 tokens

test-writer

Write PHPUnit tests for Performance Review analyzers. MUST BE USED when user says "create tests", "write tests", "add test coverage", or "need tests" for an analyzer. Use when new analyzers are created or existing ones are modified. Creates comprehensive unit tests covering happy paths, edge cases, and error…

magendooro/n98-magerun2-performance-review · 69 tokens

test-specialist

PHPUnit testing specialist who creates and maintains tests through comprehensive test strategies, fixture management, and quality validation. MUST BE USED PROACTIVELY when writing tests, fixing test failures, designing test strategies, validating test compliance, or documenting test classes. Can run concurrently with…

martinkup/symfony-profiler-optimization-advisor-bundle · 63 tokens