Warn when data provider provides more args than the method accepts

Open
#256 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
testing

Research direction

Start by comparing PHPUnit 12's warning behavior with the PHPUnit 12.4 DataProvider attribute and its validateArgumentCount parameter. Trace how phpstan-phpunit handles data providers, then verify that extra arguments are reported by default and that the parameter opts out as described.

Written by the indexing model from the issue text.

Description

Allegedly PHPUnit 12 warns about this.

At the same time, PHPUnit 12.4 adds validateArgumentCount parameter to DataProvider attribute that opts out of this error.

/cc @staabm

Dominant language
PHP
Stars
544
Forks
58
Avg merge
2d 1h
Merged PRs (30d)
5

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from phpstan/phpstan-phpunit

All issues in phpstan/phpstan-phpunit

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.