-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Description
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 😁
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels