Argument count error in PHPUnit test with data provider and depends attribute
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- php
- 領域
- testing-qa
調査の方向性
Start by reproducing the issue with the shown testSearch method, its Depends and DataProvider attributes, and providerSearchCases generator. Trace how the extension combines dependent-test arguments with data-provider arguments, then verify that the valid four-parameter method produces no arguments.count diagnostic. No repository file or existing test is named in the issue.
索引モデルが issue の本文から書いたものです。
説明
Bug report
hey there 👋
I think I found an issue within PHPUnit tests, using the Depends and DataProvider attribute on the same test method.
public function testIndexing(): IdsCollection
{
$ids = new IdsCollection();
// ...
return $ids;
}
/**
* @param list<string> $config
* @param list<string> $expectedProducts
*/
#[Depends('testIndexing')]
#[DataProvider('providerSearchCases')]
public function testSearch(array $config, string $term, array $expectedProducts, IdsCollection $ids): void
{
// ...
}
/**
* @return \Generator<string, array{list<string>, string, list<string>}>
*/
public static function providerSearchCases(): \Generator
{
yield 'search for manufacturer' => [
['name', 'description', 'customSearchKeywords', 'manufacturer.name'],
'Shopware',
['product-4'],
];
// and more
}
error:
Method Shopware\TestClassName::testSearch() invoked with 3 parameters, 4 required.
🪪 arguments.count
Unfortunately I cannot provide a playground code snippet, as PHPUnit is not available there. I also don't know, if this is a problem of the PHPUnit extension.
Expected output
no error
Did PHPStan help you today? Did it make you happy in any way?
PHPStan helps me everyday to be the last stand against AI slop 😁
- 主要言語
- PHP
- スター
- 544
- フォーク
- 58
- 平均マージ
- 2日 1時間
- マージ済み PR(30日)
- 5
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
phpstan/phpstan-phpunit のほかの issue
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
phpstan/phpstan-phpunit#332 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
phpstan/phpstan-phpunit#321 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
phpstan/phpstan-phpunit#309 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
phpstan/phpstan-phpunit#299 · コメント 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
phpstan/phpstan-phpunit#292 · コメント 3 件 ·
phpstan/phpstan-phpunit の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
a11y admissions.uiowa.edu needs grooming SiteImprove best practice
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
Save States Menu オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
pluginsGLPI/datainjection#673 ·