New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@depends doesnt work with @testWith #3450
Comments
This issue can be closed when #3449 is merged. |
@Niko9911 What is the exact issue here? In case it is a variant of the issue demonstrated below, the TL;DR is that this is a result of the current architecture and cannot be changed easily. If you search the github issues for 'dataprovider' and 'depends' you will find quite a lot of discussion. The code below shows that depending on a dataprovidered tests will not automatically rerun the test for every dataprovider row of the test referenced in <?php
class DataproviderAsDependencyParameterTest extends \PHPUnit\Framework\TestCase
{
/**
* @testdox testA($value)
* @depends testB
*/
public function testA($value): void
{
$this->assertTrue(true);
}
/**
* @testdox testB($value)
* @dataProvider someProvider
*/
public function testB($value): void
{
$this->assertTrue(true);
}
public function someProvider()
{
return [
[1],
[2],
[3],
];
}
} |
hmph, I was stypid as I didn't post reproduce here... It was something about if dependency was in x class... |
Can this be closed? |
I think so, yes. It is a request that pops up every now and then. Having looked at the way dataproviders work it won't be a simple change to get this working. |
There is issue when returning value from depended-upon test. It will always return null when using data sets.
Fix will be introduced in #3449
The text was updated successfully, but these errors were encountered: