Video: Testing can seem complicated, too much effort or a waste of time. It doesn’t have to be! I’ll show you how to reduce friction and get the most out of Drupal Test Traits.
Drupal Test Traits is a composer package that allows you to run tests against an existing Drupal site with user content in place. This approach differs from traditional PHPUnit tests that require you to mock up an environment to test individual functionality.
In the video, I take you through the following ways to reduce the friction commonly experienced with traditional testing processes:
- Getting started with Drupal Test Traits
- Writing your first test
- Building a library of project-specific traits
- Maximising your test suite’s performance and reliability
- Fostering a test culture in your development team
Watch the video
Questions? Let’s chat!
Drupal Slack: @mstrelan
Drupal allows writing tests for installation profiles. A profile can have sample content which is created during installation, like umami in Drupal core. Drupal allows writing tests for modules as well. A module can also have sample content which is created during installation or config import.
Want to keep ahead of bugs and regressions in your code?
Want to stop other members on the team accidentally breaking your code?
Want to make deployments nice and smooth?
Perhaps you want to ramp up your core commits but are overwhelmed by testing?
We are passionate about code quality. We want to make sure our code is well tested and confirms to standards at all times. If there is a bug, we want to know as soon as possible, so we can fix it and keep our code stable, well tested and bug free, even in early development versions.
Typical workflows use a git topic branch for development of each feature, and require code to be merged into a development branch before automated tests are run. The problem with this approach is it tests code after it has been reviewed and merged.
Using Jenkins for automated testing of Github pull requests, we can get one step closer to code quality nirvana.