Vancouver, October 5-6, 2012

PHPUnit In And With Drupal 8: No Unit Left Behind

Speaker(s): 
Track: 
Development and Code
Experience Level: 
Intermediate

Drupal 8 now ships with PHPUnit included. What does that mean? It means we can write super-fast unit tests that enable test-driven development practices and higher-quality code.

If you're wondering, "What do you mean by 'unit?'" then this talk is for you.

Some things you're likely to learn during this talk:

  • Why you should write tests
  • Brief overview of testing strategies: Behavioral, functional, and unit testing
  • How to run PHPUnit in Drupal 8 (Using Testing module and from the command line)
  • How to generate a coverage report
  • What you can learn from coverage reports
  • Drupal 8 file location standards for PHPUnit, so you can write tests for your contrib module

We'll be walking through the PHPUnit Example, from the Examples for Developers project. It's not complete at this time, but here's the issue: https://drupal.org/node/2032697

Things I'll end up talking about, but which I'd really rather not spend much time on:

  • Namespaces
  • PSR-0
  • General knowledge of OOP in PHP
  • How the command line works

I made a page with some support materials for the talk here: http://mile23.com/phpunit-talk