March 2019
Intermediate to advanced
580 pages
15h 3m
English
There are certain commonalities between the various test suite types regarding what we need to do in order for Drupal (and PHPUnit) to be able to discover and run them.
First, we have the directory placement where the test classes should go in. The pattern is this: tests/src/[suite_type], where [suite_type] is a name of the test suite type this test should be. And it can be one of the following:
So, for example, unit tests would go inside the tests/src/Unit folder of our module.
Second, the test classes need to respect a namespace structure as well:
namespace Drupal\Tests\[module_name]\[suite_type]
This is also pretty straightforward to understand.
Third, there is a certain ...
Read now
Unlock full access