Depends on phpunit doesn't seem to work
Maybe it's just me, but @depends
doesn't seem to work as I expected. My code:
<?php
use PHPUnit\Framework\TestCase;
class MyTest extends TestCase
{
/*
* @depends testFunc1
*/
public function testFunc2()
{
exit('TEST FUNC 2 called');
}
public function testFunc1()
{
exit('TEST FUNC 1 called');
}
}
When I do phpunit MyTest.php
, I expect to see TEST FUNC 1 called
, but instead I see TEST FUNC 2 called
. It seems to be simple to run the tests in the order they appear in the script, regardless of the attribute @depends
that is really asking the question: what does @depends
it actually do?
I am running PHPUnit 5.7.20.
+3
source to share