Testing for the Brave and True
summary
Drupal 8 testing is shown end-to-end: use PHPUnit and Behat for fast unit checks and slower browser tests, organize code into services and inject dependencies so classes are mockable, run UnitTestCase, KernelTestBase and WebTestBase from UnitTestCase/KernelTestBase/WebTestBase, and use a temporary sqlite test database so tests never touch production. A tiny calculator module demonstrates mocking with Prophecy, asserting method calls and edge cases, and running tests from a CLI script.
AI-written summary · about
related talks
01h 00mPrinciples of Unit Testing
36mTest driven development in Drupal 8
49mBending Behat's Benefits: A live coding adventure
29mEffective tests and testing effectively
52mWriting Unit Tests Using PHPUnit
56mUnit Testing by Example
59mYour tests are mocking you
46mTest Your Drupal Site The Easy Way: Use Cypress
