Last updated June 15, 2020

Let's write somewhat strict unit tests in a Drupal 8 module. By the end of this tutorial, you will be able to:

  • Understand what makes a unit test different from other types of tests.
  • Determine the specifications of a unit test.
  • Use mocking to isolate units under test, and to force code flow to achieve high coverage.