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.

0/5

Change document root in nginx for external drive

I have a scenario in which I use Windows and Ubuntu on the same machine, and I want my sites to be shared across the OS. I have created a directory called 'common-sites' on my D drive, and I have configured the Drupal site with the domain drupal-demo-8.com.

My Ubuntu has an nginx web server. I want my common-sites to be available for Ubuntu as well.

Approach

0/5

Drupal console with aquia/blt drupal 8

The Drupal console makes Drupal developers' lives really easy.

Install the Drupal console on your system.

Download and move it to the local path with execute permission, then run the following commands:

curl https://drupalconsole.com/installer -L -o drupal.phar
mv drupal.phar /usr/local/bin/drupal
chmod +x /usr/local/bin/drupal

Run the following command to copy the config file into your home directory.

0/5