Test driven development in Drupal 8
summary
Tests are used to drive module design and catch regressions, demonstrated with a working Connect Four module (repo: nuez/connect_four). Concrete tooling: Unit, Kernel, Browser, JavaScript tests using PHPUnit, Mink, PhantomJS (PhantomJS noted as unmaintained), and Prophecy mocks for fast unit tests. Unit tests run in milliseconds, kernel tests need partial bootstrap, browser/JS tests require full installs and are slow. A YAML data provider runs three scenarios to verify the “get maximum moves in line” logic; tests pass and the game works.
AI-written summary · about
chapters (13)
- 0:00Start
- 0:14Test-Driven Development in Drupal 8
- 2:27Kernel Test
- 6:01How Do I Start with Testing in Drupal 8
- 6:52Where Do these Tests Go
- 8:21Maximum Sum of Simultaneous Connections
- 9:26Build a Module
- 16:42Write a Kernel Test
- 18:47Data Provider
- 23:29Unit Test
- 28:28Javascript Test
- 31:46Why You Would Test
- 32:27Kernel Tests
related talks
49mTesting for the Brave and True
01h 00mPrinciples of Unit Testing
01h 05mLightning fast tests
45mTesting Big in JavaScript
46mTest Your Drupal Site The Easy Way: Use Cypress
29mEffective tests and testing effectively
50mAutomate your testing with Nightwatch.js
49mBending Behat's Benefits: A live coding adventure
