We want to get rid of simpletest.module in Drupal 9. We want to prepare the latest Drupal 8 development branch as much as possible before opening the Drupal 9 development branch (see). Therefore we need to convert all web tests to BrowserTestBase or UnitTestBase or KernelTestBase and deprecate WebTestBase.
More discussion can be found in the original phpunit conversion issue at.
Process for the big bang conversion patch (DONE!)
Because changing tests to a new system is a disruptive change we want to schedule a date in February 2017 where we commit one "big bang" patch prepared in. It will contain scripted test case conversions where only files are moved to use BrowsertestBase.
- There will be a Drupal core fork on Github that has a branch which contains all the conversions https://github.com/klausi/drupal/tree/8.3.x-phpunit
- klausi and dawehner will regularly push conversions to that branch.
- We will regularly create patches from that branch and post it to .
- We will trigger multiple test runs on all the testbot environments so that we always check for random test fails.
- We will reach out to the community on groups.drupal.org and social media to inform them of the exact date where we will commit this conversion patch. It will be an announced scheduled change.
Converting Simpletests per module
After this big bang patch is committed there will be some remaining Simpletests that we need to convert to PHPUnit manually per module. This is coordinated in.
We will deprecate Simpletest's WebTestBase in 8.4.x, but not for 8.3.x releases. Between the release of 8.3.0 and 8.4.0 we will polish our PHPUnit browser tests and then WebTestBase will be deprecated and forbidden for new tests with the release of 8.4.0 in October 2017. See.
Process for compatibility and better tests
As a parallel effort we will improve the compatibility layer between the old WebTestBase and BrowserTestBase. Those issues will be committed to Drupal core immediately when they are ready (no need to wait for them until February 2017.
- Convert web tests to kernel tests that don't use a browser at all.
- Improve AssertLegacyTrait for maximum compatibility with SimpleTest.
- Experiment with forwards compatible additions to WebTestBase (example: a clone of xpath() method to return Mink DomDocument objects instead of SimpleXML):
- Complex conversions are researched on top of it, for example for upgrade path tests:
- Monitor random test fails that come up during testing the big bang patch like
- Update code comments and in-code documentation to describe phpunit-based browser tests
- The PHPUnit browser test tutorial needs review.
- A single high-level overview of Drupal's PHPUnit testing APIs, summarizing what PHPUnit is at a high level, and listing out the four kinds of tests you can add (unit, kernel, browser, and JS) and when to use each. Each would provide links to the more in-depth documentation for that type of test.
- https://www.drupal.org/contributor-tasks/write-tests should be updated (ands probably link relevant D8 documentation so that it doesn't get stale in the future)
Not in scope
Team and resources
Communication and planning:
- Claudiu Cristea (claudiu.cristea)
- Matt Glaman (mglaman)
- Jibran Ijaz (jibran)
- larowlan when time permits
- Please add yourself ...
oh yeah, we need that too. Maybe @alexpott?
Please add the tag 'phpunit initiative' to every issue and add the issue to the correct Component (if it's a test for the comment module, add it to comment.module).
We have signoffs from a Drupal 8 release manager (xjm) and a Drupal 8 framework manager (alexpott) as well as Dries.