Writing Simple (PHPUnit) Tests for Your D8 module
I've previously explained why automated tests should be written for Drupal. and I've shown how to add tests for a Drupal 7 module, now we'll look at how to add a test for a Drupal 8 module.
Note: In the interest of making this a standalone article, much of the same verbose explanations will be repeated from the previous article.
Writing Simple (Simpletest) Tests for Your D7 module
I've previously explained why automated tests should be written for Drupal, so now I'll show how to add some tests to an existing Drupal 7 module.
Another article is available showing how to write tests for Drupal 8.
Our goal: Make sure the module doesn't break the site
This guide is going to do add tests to do two very simple things: