Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drupal Tests in wrong place #621

Open
whikloj opened this issue May 12, 2017 · 0 comments
Open

Drupal Tests in wrong place #621

whikloj opened this issue May 12, 2017 · 0 comments
Labels
Status: test-needed identifies where tests should be added but haven't been. Subject: Drupal related specifically to Drupal, usually pointing somewhere on drupal.org

Comments

@whikloj
Copy link
Member

whikloj commented May 12, 2017

Apparently Drupal have no idea what or where tests should go. Because I am finding some weird information.

So in Islandora where IslandoraKernelTestBase extends KernelTestBase all our files fall under the section Writing Functional Tests

The important bits are

  • For functional tests that do not test web output, define a class that extends \Drupal\KernelTests\KernelTestBase. This class is much faster than WebTestBase, because instead of making a full install of Drupal, it uses an in-memory pseudo-installation (similar to what the installer and update scripts use). To use this test class, you will need to create the database tables you need and install needed modules manually.
  • The namespace must be a subspace/subdirectory of \Drupal\yourmodule\Tests, where yourmodule is your module's machine name.
  • The test class file must be named and placed under the yourmodule/src/Tests directory, according to the PSR-4 standard.

So ours are all using:

  • the namespace \Drupal\Tests\islandora which should be \Drupal\islandora\Tests
  • are in the path Tests/src/Kernel which should be src/Tests/Kernel

Except that PSR-4 seems to state that tests are not placed in the src/ directory. So perhaps Drupal documentation is completely wrong?

@Natkeeran Natkeeran added the tests label Jun 2, 2019
@kstapelfeldt kstapelfeldt added Status: test-needed identifies where tests should be added but haven't been. Subject: Drupal related specifically to Drupal, usually pointing somewhere on drupal.org and removed tests labels Sep 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: test-needed identifies where tests should be added but haven't been. Subject: Drupal related specifically to Drupal, usually pointing somewhere on drupal.org
Projects
Development

No branches or pull requests

3 participants