Module Development

Configure Your Environment to Run Tests for Drupal 8, 9, 10, and 11

Before you can run tests, you'll need to configure your local environment. This setup involves Drupal-specific configuration for PHPUnit and ensuring your environment supports Functional JavaScript tests with a WebDriver client and a compatible browser. The setup process varies based on the development environment. In this tutorial, we're using DDEV as the local environment.

In this tutorial, we'll:

  • Install all required dependencies.
  • Configure PHPUnit specific to our environment.
  • Validate the setup by running a Drupal core test.

By the end of this tutorial, you'll be equipped to run Drupal's PHPUnit tests locally using DDEV.

Drupal Module Developer Guide