mock-chain: a library for easier unit testing in Drupal (and beyond!)

Presenters: dafeder, fmizzell

 

Unit tests are a critical tool for development, ensuring that classes and functions aren't inadvertently broken by new code. While Drupal has moved toward modern PHP conventions and made unit testing more feasible for module developers, it remains difficult in many cases to run tests without bootstrapping Drupal to have access to services like database or translation. The DKAN team created mock-chain to make building mocks for these services and other complex objects much simpler and has reduced the amount of time we spend writing unit tests significantly. In this talk we will write a new test from scratch and demonstrate how to leverage mock-chain.

Audience
Experience Level
Advanced
Status
Proposed
Session Track