I have several tests that are with names that will autoload in package A using
"autoload-dev": { "psr-4": { "Vendor\\PackageA\\PhpUnit\\": "tests/PhpUnit" } },
This works great.
I have another package, package B, which also has name extension tests that require one of the tests with names in package A
"autoload-dev": { "psr-4": { "Vendor\\PackageB\\PhpUnit\\": "tests/PhpUnit" } },
However, when I try to include the file in package B, the class was not found
use Vendor\PackageA\PhpUnit\MyTestFromA; class MyTestFromB extends MyTestFromA {
Make me think that autoload-dev files from other packages are not loading.
PHP Fatal error: Class 'Vendor \ PackageA \ PhpUnit \ MyTestFromA' not found in /full/path/to/PackageBClass.php on line 3
When I try to import a file that is automatically loaded using autoload from package B and not autoload-dev , I get no error.
How can I overcome this?
Part of me is thinking of making the package only for tests and automatically downloading it without autoload-dev , but first I want to confirm.
source share