Setup PHPUnit for Drupal 8/9
PHPUnit is a unit testing framework for the PHP programming language. It is an instance of the xUnit architecture for unit testing frameworks that originated with SUnit and became popular with JUnit. PHPUnit was created by Sebastian Bergmann and its development is hosted on GitHub.
In this example, we are going to setup PHP Unit for Drupal 8/9 projects, so let's create a vanilla Drupal project with the recommended template.
Create a Drupal project with composer using the recommended template.