Repository navigation
Description
Summary
The testing plugin's cannot-fail scanner (/testing:audit, and the test-scan and test-weaken hooks that run the same engine) covers JS/TS, Python, C#, Bash, PowerShell and Go. PHP test files are never enumerated, so a PHPUnit or Pest test with no assertion, or one that can only pass, goes unreported and the hooks never fire on a PHP test edit. Add a PHP adapter for PHPUnit and Pest.
Assertion forms to recognize:
- PHPUnit: four spellings of each assertion,
$this->assertTrue(),self::assertTrue(),PHPUnit\Framework\Assert::assertTrue()and the globalassertTrue(), with names such asassertSame,assertEquals,assertCountandassertInstanceOf, per the PHPUnit docs: https://docs.phpunit.de/en/13.4/assertions.html - Pest:
expect($value)->toBe(3); expectations chain on one subject (->toBeInt()->toBe(3)),->notnegates the next matcher, and->and($other)moves the chain to a new subject, so one statement can hold assertions on several values; tests are declared withtest()orit(), per the Pest docs: https://pestphp.com/docs/expectations
Scope
plugins/testing/skills/audit/adapters/php-phpunit.yamlandphp-pest.yaml:files:globs (for example*Test.php; confirm against each framework's conventions),test_startfor PHPUnitpublic function test*(and#[Test]-attributed methods and Pesttest(andit(closures,test_skip(markTestSkipped,markTestIncomplete, Pest->skip()and->todo()), and the assertion, weak, inert (assertTrue(true),expect(true)->toBeTrue()), count (assertCount,->toHaveCount), fail (fail() and mock (createMock,->expects(, MockeryshouldReceive) token sets.expectException()is an oracle and must count.- Masker: add
mask_phptoplugins/testing/skills/audit/scripts/cant-fail-scan.awk://,#and/* */comments (but#[opens an attribute, not a comment),'and"strings with{$var}interpolation, and heredoc (<<<TAG) and nowdoc (<<<'TAG') bodies masked to their closing tag line, which may be indented.mask_sh's heredoc state is a model to borrow from. Register it inmask_openand routelanguage: phpto it. - Corpus fixtures under
plugins/testing/skills/audit/evals/fixtures/corpus/<adapter-id>/{bad,good}/(stored as.fixture), each listed incorpus_filesincant-fail-scan.test.sh. - Regenerate
plugins/testing/hooks/hooks.jsonwithplugins/testing/scripts/gen-hook-filters.shso the hooks'ifrows include the new globs. - Add PHP to the language lists in
plugins/testing/skills/audit/SKILL.md(description and ecosystems paragraph) andplugins/testing/README.md. - Version bump and CHANGELOG entry for testing.
Acceptance criteria
- A PHPUnit test method and a Pest
test()closure with no assertion each reportrule-zero-assertion. - A test with one real assertion in each framework, in each of PHPUnit's four spellings, reports nothing.
- A Pest
->and()chain is classified per statement: a chain holding a real matcher stays quiet, and one whose matchers are all inert is flagged. - An assertion token inside a
#or//comment, a heredoc or a nowdoc does not count as an assertion; a#[Test]attribute line is not masked as a comment. - A skipped test (
markTestSkipped, Pest->skip()) is not reported as zero-assertion. - Every new fixture is in
corpus_files, andcant-fail-scan.test.shandcheck-corpus-grid.shpass. -
gen-hook-filters.sh --checkpasses after regeneration, andgen-hook-filters.test.shpasses.
Dependencies
Land after the in-flight scanner PR for #6211, #6218 and #6040, since all of them edit cant-fail-scan.awk, the corpus list and hooks.json. Run the four language adapters (Kotlin, C++, PHP, Ruby) one at a time for the same reason.
Rough size
Medium: a new masker (heredoc and nowdoc state, # versus #[) plus Pest's chained-expectation classification. Statements end in ; and blocks use braces, so the existing brace block model fits.
Activity
github-actions commentedon Oct 4, 2026
Thanks for the detailed writeup. This asks for a new PHP adapter (PHPUnit + Pest) for the cannot-fail scanner, covering the masker, corpus fixtures, hook filter regen, and docs updates — scope and acceptance criteria are clear and nothing appears missing.
This is part of a series alongside similar adapter requests for Kotlin (#6235), C++ (#6236), and Ruby (#6238); not a duplicate, but worth sequencing per the stated dependency on the in-flight scanner work and running the four adapters one at a time as noted.
Automated triage. A maintainer reviews it.
kyle-sexton commentedon Oct 13, 2026
Owner decision (2026-10-13): approved the recommendation.
#[attributes) and rules for Pest expectation chains.Basis: git ls-tree origin/main plugins/testing/skills/audit/adapters/ (no php adapter); gh api orgs/melodic-software/repos (no PHP repository)
Next: nobody acts now. Pick it up when one of the triggers above appears.
This was generated by AI.
kyle-sexton commentedon Oct 19, 2026
This was generated by AI during triage.
Hold: the owner decision of 2026-10-13 parks this adapter until a repository the owner works in uses PHP or an outside user asks for it; neither trigger has happened.
kyle-sexton commentedon Oct 24, 2026
Decision recorded. Owner, Backlog HITL session, 2026-10-24. Q99: "Should the six issues parked until demand appears close as not planned, each with a reopen note?" Answer: "yes, go w/ recomended". To reopen: reopen this issue when a repo uses this or a user asks for it; the body and decisions above stay as the spec.