Testing is important... Why? It allows developers to add new features and edit and refactor existing code without the worry of adding regressions, reduces the reliance on manual testing to discover bugs, and by taking a test driven approach, your implementation code is leaner and easier to maintain.
Since Drupal 8, Drupal has shipped with PHPUnit and uses it for its unit, integration and functional tests. Also, with testing as one of the Drupal core gates, with tests needing to be included with every new feature or bug fix, and core’s 100% pass rate policy, testing has become an essential skill when contributing to core, or when working on your own projects.
In this workshop, we’ll cover the methodology, approaches and terminology involved with automated testing, look at some examples and work through some exercises, and then take a test driven development approach to creating a new Drupal module.
Following this workshop, attendees should:
- Know what types of tests are available in Drupal 8.
- Understand the different approaches to testing.
- Know how to add tests to existing code.
- Understand the concepts of test driven development (TDD) and how to use apply them when writing new code.
- A good working knowledge of Drupal and PHP.
- A laptop with a local copy of Drupal 8 for running tests locally.
- Recommended: PhpStorm or Visual Studio Code for editing code.