Maybe it's just me but @depends doesn't seem to be working as I'd expect it to. 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'd expect to see TEST FUNC 1 called but instead I see TEST FUNC 2 called. As is it seems to just be running the tests in the order they appear in the script, regardless of the @depends attribute, which really begs the question: what does @depends actually do?
I'm running PHPUnit 5.7.20.
You need to use /** instead of /* to start a docblock.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With