BTB seems to be working well. Let's deprecate WTB so people start making new tests using BTB.

Proposed resolution

Deprecate WTB in favor of BTB.

Remaining tasks

User interface changes

API changes

Data model changes

#2 2847678-02.patch493 bytesmpdonadio


mpdonadio created an issue. See original summary.

mpdonadio’s picture


mpdonadio’s picture

Status: Active » Needs review
dawehner’s picture

I would say totally +1 as of 8.4.x
IMHO we should wait until we commit the conversions.

One important point maybe, what should happen with new tests. For me this will be solved kind of automatically and we don't need a policy. People will use the new test base over time, while we convert remaining ones at the same time.

mpdonadio’s picture

If we formally deprecate this, then don't we have an official (or semi-official) policy already that we don't commit new patches w/ deprecated code in them, except at the discretion of the committers as long as justification is provided? For this case, I don't see that happening as I think we have the Drupal specific things covered in BTB, and Mink provides a much better framework for the actual assertions (every time I write a test I learn how to do something better).

The biggest win with this patch is that PhpStorm and other IDEs that understand DocBlocks is that people will know to start using BTB when making new tests, and so will people who review patches applied.

I would be in favor of tweaking the language to mention that KTB or UTC should be considered if it isn't a proper functional test.

larowlan’s picture

I love it when a plan comes together

claudiu.cristea’s picture

Hm. I think we should fix this #2803621: Break BrowserTestBase & children dependency on Simpletest before.

EDIT: Note that BTB is a core feature that depends on a module. This is conceptually wrong.

klausi’s picture

I think deprecating WebTestBase in 8.3.x is a bit too early. We need to get our big initial conversion patch in, then do some more manual conversions of what is left to gain more experience and confidence in BrowserTestBase. If everything goes smoothly we can then deprecate WebTestBase in 8.4.x, meaning contrib developers will see it first when 8.4.0 is released in October 2017.

I don't think issues such as #2803621: Break BrowserTestBase & children dependency on Simpletest are blockers for the deprecation because BrowserTestBase is usable without that.

klausi’s picture

Status: Needs review » Postponed

Postponing this at least on #2770921: Feb 21st: Convert chunk of WTB to BTB by just moving classes, changing use statements adding traits. I think we need a bigger chunk converted to BrowserTestBase before we deprecate Simpletest.

mpdonadio’s picture

Issue tags: +DrupalCampNJ2017

@xjm and I talked a little about this at DrupalCampNJ. She doesn't think it is a good idea to formally deprecate WTB until we can prove that all of our tests can be converted sucessfully.

So, the tests that aren't in the mass conversion are blocking this. I think the issue about WebTestBase::drupalPostAjaxForm() is the main blocker, but I am also trying to figure out how to work around a particular usage of AssertContentTrait::setRawContent() w/o a major rework of two datetime tests classes.

I still think a formal policy about no new WTB after 2017/02/21 would be a good idea, even if we aren't deprecating it yet. That way we would have something to point to when doing patch reviews.

klausi’s picture

Status: Postponed » Active
klausi’s picture

Our original proposal for a timeline that we came up with in September 2016 in #2807237: PHPUnit initiative: 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.

Mile23’s picture

Drupal 8.0.1 is released, so this is back on, please. :-)

Looking for but can't find the how-to-convert-your-test doc. That should be a @see on this.

michielnugter’s picture

Issue tags: +phpunit initiative