Module Development

Run Drupal Tests with the Script for Drupal 8, 9, and 10

This page is archived

We're keeping this page up as a courtesy to folks who may need to refer to old instructions. We don't plan to update this page.

Drupal core comes with a script to help with running tests. This script has some distinct advantages over running tests directly via PHPUnit. It runs all tests in their own separate process, and can therefore handle PHP fatal errors without killing the test run. It's also the mechanism that the Drupal CI tools use to run tests; so, it can be handy when debugging tests that are failing on

In this tutorial we'll:

  • Look at the available options for the core script
  • Go through some examples of running tests using

By the end of this tutorial you'll know how to run your tests using