How to Write PHP Unit Tests for Drupal 8

rakeshjames

March 30, 2017

Banner for PHP Unit Test for Drupal 8

We all know that PHPunit testing framework has been added into Drupal 8. More than that SimpleTest in Drupal 8 is deprecated now. So let’s learn about, how to write the PHPUnit test for our requirement. The following Topics were covered during DrupalCamp Mumbai 2017 session. We are covering in the slides.

  • Why PHPUnit?

  • Things we need to know before writing PHPUnit Test Case?

    • Files Structure and namespace

    • PHPUnit Base Classes

  • How to write a PHPUnit Test?

  • Running PHPUnit tests

  • How to integrate with PHPStorm?

 

Let’s team up and unlock amazing possibilities!