chiefmyron / phpunit-test-workbench

An extension to integrate PHPUnit with the native Test Explorer functionality within VS Code. Zero configuration required for common environment setups.
https://marketplace.visualstudio.com/items?itemName=chiefmyron.phpunit-test-workbench
MIT License
5 stars 2 forks source link

Organizing by namespace does not work #104

Closed solarfluxx closed 3 months ago

solarfluxx commented 3 months ago

When using "phpunit-test-workbench.phpunit.testOrganization": "namespace" the testing panel still shows the namespaces with the class names.

settings.json

{
  "phpunit-test-workbench.phpunit.testOrganization": "namespace",
}

SomeTest.php

<?php

namespace Foo\Bar\Quk;

use PHPUnit\Framework\TestCase;

class SomeTest extends TestCase {
    public function testSomething() {

    }
}

image

solarfluxx commented 3 months ago

After tracing through the code, I see that a composer.json file needs to be defined with the "autoload" property configured.

composer.json

{
  "autoload": {
    "psr-4": {
      "Foo\\": "Foo/"
    }
  } 
}

This understanding resolves the issue for me.