Skip to content

software-writer: writing-tests PHPUnit reference names only the #[DataProvider] attribute #61

Open

Description

@SpiGAndromeda

After #60, plugins/software-writer/skills/writing-tests/references/stacks/php/phpunit.md is one line:

Table construct: the #[DataProvider('providerName')] attribute on the test method, naming a public static provider whose string keys name the cases.

PHPUnit 9 does not read attributes; it uses the @dataProvider docblock annotation. An agent that follows this line in a PHPUnit 9 project writes a provider PHPUnit never calls.

The sweep's sweeping-dead-code/references/stacks/php/phpunit-referenced-by-name.md already names both forms ("older versions use the @dataProvider and @depends docblock forms"). There the clause is a step input: the sweep must recognize references in existing code of any version.

Open question

Does the content rule from #60 admit a clause naming @dataProvider in the writing-tests reference?

  • For: without it, the reference directs a PHPUnit 9 project to a construct that does not work (misdirection fix).
  • Against: the expected failure is loud (the parameterized test runs without arguments and errors on the first run), so the agent corrects it without the clause. The clause also brings back version-specific text, which refactor(software-writer)!: less error surface, more agent judgment #60 removed. This failure mode is reasoned, not reproduced on PHPUnit 9.

Reach is low: PHPUnit 9 projects only.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions