Skip to Main Content
Close Menu

Updating deprecated test classes extending WebTestBase in Drupal 8


This covers only the most common use cases.

Instead of extending Drupal\simpletest\WebTestBase, extend Drupal\Tests\BrowserTestBase.

Due to extensive changes, you may need to rewrite your tests to use the new base class..

A little more information

The new test classes are similar, but not similar enough to be automatically updated. recommends reading

Automating updates with Drupal Rector

Drupal Rector is an open source tool built using Rector which can help automate this deprecation as well as other common deprecations.

For more information, see

What is covered by the rector

This deprecation is not currently covered by Drupal Rector.

Deprecation background

The new test classes use PhpUnit and Mink and take advantage of community tools outside of Drupal.


The Drupal change record for this deprecation is available at  

Let’s work together.

Have an exceptional idea? Let's talk and see how we can help.
Contact Us