Skip to main content

PHPUnit

Running Drupal's PHP Unit tests with Headless Chrome Image and ddev

Submitted by daniel on

In a previous article I have looked at running Drupal's Nightwatch and PHPUnit Tests using Drupal's Quickstart development environment. Today, I will look at how to run all the the PHP Unit Tests using a headless version of chrome.

Setting up Headless Chrome Image

Within your project root within the .ddev folder create a new YAML file and call it docker-compose.chromedriver.yaml

Getting started with both Functional Javascript and Nightwatch Testing in Drupal 8.6 or later

Submitted by daniel on

In a previous article, I looked into how to get started with Running Tests using Drupal Contributions on top of a local Lando container. I looked a little at the history of Drupal testing and in particular how to get started running PHP Unit tests. 

Types of Drupal Tests

If we look at core Drupal Views module under tests/src we can see the following in the core/tests folder