This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
oliverdavies.uk-old-sculpin/source/_talks/test-driven-drupal-simpletest-phpunit.md

29 lines
2.1 KiB
Markdown
Raw Normal View History

2017-02-19 14:52:08 +00:00
---
2017-03-08 08:07:54 +00:00
title: Test Driven Drupal Development with SimpleTest and PHPUnit
2017-03-14 08:18:57 +00:00
type: Talk
2017-03-08 08:07:54 +00:00
slides:
2017-03-18 23:10:40 +00:00
url: https://speakerdeck.com/opdavies/test-driven-drupal-development-with-simpletest-and-phpunit-drupalcamp-london-17
2017-05-01 23:38:38 +00:00
embed: '<script async class="speakerdeck-embed" data-id="4f12722ed400468b93ebb32a23b3c757" data-ratio="1.77777777777778" src="//speakerdeck.com/assets/embed.js"></script>'
2017-03-29 18:03:02 +00:00
video:
url: https://www.youtube.com/watch?v=fdbxXOi2HP4
embed: <iframe width="560" height="315" src="https://www.youtube.com/embed/fdbxXOi2HP4" frameborder="0" allowfullscreen></iframe>
2017-03-04 23:39:17 +00:00
tags: [drupalcamp, simpletest, phpunit, testing]
2017-05-02 00:12:43 +00:00
meta:
og:
title: Test Driven Drupal Development with SimpleTest and PHPUnit
description: "How to write tests and follow TDD for Drupal applications."
type: website
image:
url: /assets/images/talks/test-driven-drupal-development.png
width: 2560
height: 1440
type: image/png
events:
2017-03-19 10:03:16 +00:00
- { id: drupalcamp-london-17, date: '2017-03-04', time: '16:15 - 17:00' }
2017-02-19 14:52:08 +00:00
---
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 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. And with testing being one of the Drupal core gates with tests needing to be included with every new feature or bug fix, and cores 100% pass rate policy, testing has become an essential skill when contributing to core, or when working on your own projects.
In this talk, well cover the methodology and terminology involved with automated testing, and then take a test driven approach to creating a new Drupal module.