Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
I've been evaluating Phpactor recently whilst working on Drupal projects and found that I was getting a
There are no class name candidates
error when trying to create a new class.After installing this plugin and dumping an updated autoloader, creating a class within a module's
src
directory worked, but it still couldn't generate a test class within thetests/src
directory.Solution
Reviewing the autoload_psr4.php file, I could see that the module's
src
directory was being loaded correctly but thetests/src
directory wasn't included.After adding one manually to confirm it fixed the issue, I've created this PR that checks for a
tests/src
directory within each module and if one exists, adds it to the expectedDrupal\\Tests\\
namespace`.