Problem/Motivation

Got a warning on a client project when Composer generates the autoloader.

A namespace is wrong in a test class.

root@558f99f33bb9:/app# composer dump-autoload
Generating optimized autoload files
Class Drupal\Tests\search\Nightwatch\Olivero\TestSiteOliveroInstallTestScript located in ./web/core/modules/search/tests/src/Nightwatch/Tests/Olivero/TestSiteOliveroInstallTestScript.php does not comply with psr-4 autoloading standard (rule: Drupal\Tests\search\ => ./web/core/modules/search/tests/src). Skipping.

The project is using the package "fenetikm/autoload-drupal" which allowed to highlight the problem.

The project is currently on Core 11, that's why the path to the search module is still in Core on the message.

For Core fix on 11.x, I have created the issue #3636716: Wrong namespace in a test class.

Issue fork search-3636714

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

grimreaper created an issue. See original summary.

grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Active » Needs review

Not sure which one is better between fixing the namespace or moving the files one folder up.

xmacinfo’s picture

Status: Needs review » Needs work

Tests are failing.

Please document the warning you received on a client's project in the IS.

grimreaper’s picture

Issue summary: View changes
Status: Needs work » Needs review

The failing tests are unrelated to the change proposed in the MR.

IS updated.

xmacinfo’s picture

Status: Needs review » Fixed

OK Florent. You are officially the first committer for the contrib version of Search. MR number 1.

Merci beaucoup.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

grimreaper’s picture

I did not notice the MR number :)

Thanks Jacques :)