recca0120 / vscode-phpunit

The VS Code Test Explorer extension for PHPUnit
MIT License
130 stars 45 forks source link

Not showing all test classes #164

Open ennorehling opened 1 year ago

ennorehling commented 1 year ago

The Test Explorer fails to pick up some tests when they extend other tests.

For example, I have the following test classes:

abstract class FooInterfaceTest extends TestCase {
    public function test_foo() {
        $this->assertTrue(true);
    }
}

final class FooTest extends FooInterfaceTest {
    public function test_bar() {
        $this->assertTrue(true);
    }
}

final class FakeFooTest extends FooInterfaceTest {
}

What I expect to see is both FakeFooTest FooTest with one and two tests respectively listed in the explorer. What I see instead is only the FooTest, and only the test_bar function that it implements, not the test(s) that it receives from the class that it extends. Running vendor/bin/phpunit from the shell runs all of my tests, the Test Explorer does not.

NB: What I'm trying to do here is to test both a class and its testing double, without duplicating the tests.

jlecordier commented 1 year ago

Out of curiosity, does this work when using regular PHPUnit ?

TimoLehnertz commented 5 months ago

Yes it does. I have the same issue. I love the extension but half my tests wont get executed because of this