Add Drupal Test Traits ADR
This commit is contained in:
parent
7f7d551312
commit
77149e1dff
1 changed files with 25 additions and 0 deletions
25
docs/architecture-decisions/003-drupal-test-traits.txt
Normal file
25
docs/architecture-decisions/003-drupal-test-traits.txt
Normal file
|
@ -0,0 +1,25 @@
|
|||
Use Drupal Test Traits
|
||||
|
||||
Date: 2025-06-10
|
||||
|
||||
Status: accepted
|
||||
|
||||
Context:
|
||||
|
||||
Drupal Test Traits is a module that provides a number of traits to make it easier to write automated tests for an existing website.
|
||||
|
||||
Decision:
|
||||
|
||||
Adopt Drupal Test Traits for any custom module tests that won't be contributed back to Drupal.org - e.g. the opd_presentations module.
|
||||
|
||||
Consequences:
|
||||
|
||||
Using Drupal Test Traits will make it simpler to write tests without needing to create test-specific modules that only create configuration like content types and fields.
|
||||
|
||||
In some cases, I will need to change the approach for a test.
|
||||
|
||||
For example, I can't create a single presentation node in a test and assert there is only one presentation as there will be existing presentations in the database.
|
||||
|
||||
Also, because Tome automatically exports content to JSON files, it will export any content created within the tests.
|
||||
|
||||
I'll need to reset the files within the `content` directory and run `drush tome:import` to reset the database with the required content.
|
Loading…
Add table
Add a link
Reference in a new issue