TDD - Test-Driven Drupal
Testing is important.
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 as you only write what is needed for your tests to pass.
Drupal 7 includes the SimpleTest module for unit and functional testing, whilst Drupal 8 also includes and supports PHPUnit - the defacto PHP testing framework used by other PHP projects, including Symfony and Laravel - making it easier for people to test their code.
With testing being 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 the core or when working on your own projects.
In this talk, we'll cover the methodology and terminology involved with automated testing and then take a test-driven approach to create a new Drupal module.
P.S. If you want to learn more about automated testing and test-driven development in Drupal, register for my free 10-day email course.
Slides
Video
Events
- DrupalCamp London 2017 in London, UK - March 4th, 2017
- DrupalCamp Dublin 2017 in Dublin, Ireland - October 21st, 2017
- Drupal Bristol in Bristol, UK - November 22nd, 2017
- Drupal Somerset in Glastonbury, UK - June 14th, 2018
- Drupal Developer Days 2018 in Lisbon, Portugal - July 5th, 2018
- DrupalCamp London 2019 in London, UK - March 2nd, 2019
- NWDUG - May 12th, 2020 (online)
- Bay Area Drupal Camp (BADCamp) - October 14th, 2020 (online)
- DrupalCon Europe 2020 - December 8th, 2020 (online)
- DrupalCon Lille 2023 in Lille, France - October 17th, 2023
- DrupalCamp Belgium in Ghent, Belgium - May 10th, 2024
- Drupal London Meetup - November 20th, 2024 (online)