Last updated June 22, 2016. Created on October 20, 2013.
Edited by klausi, heykarthikwithu, pfrenssen, charginghawk. Log in to edit this page.

The testing framework PHPUnit was added to Drupal 8 in June of 2013. SimpleTest is still supported but is deprecated. Any new tests should be written using the PHPUnit based classes UnitTestCase, KernelTestBase, BrowserTestBase (web tests) or JavascriptTestBase (javascript enabled web tests using PhantomJS).

This handbook section contains documentation specific to Drupal's implementation of PHPUnit. See PHPUnit's documentation for support on writing tests.

Some PHPUnit tests may require specific extensions and if missing those tests will be skipped.

General PHPUnit Resources

Drupal documentation

Looking for support? Visit the forums, or join #drupal-support in IRC.