Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
WebTestBase is being deprecated, it is recommend to convert all tests to BrowserTestBase.
Comment | File | Size | Author |
---|---|---|---|
#18 | 2820214-18.patch | 35.84 KB | Lendude |
|
Comments
Comment #2
DamienMcKennaMarking this "postponed" as I won't be looking at it until after 1.0.
Comment #3
DamienMcKenna8.x-1.0 is out, so this is fair game again.
Comment #4
DamienMcKennaDetails on how to simplify the conversion: #2770921: Feb 21st: Convert chunk of WTB to BTB by just moving classes, changing use statements adding traits
Comment #5
DamienMcKennaWIP.
Comment #6
DamienMcKennaMore WIP.
Comment #7
DamienMcKennaMore improvements.
Comment #10
DamienMcKennaFYI these won't work with 8.2.x because the backwards compatibility layer is only in 8.3.
Comment #11
DamienMcKennaA lot of the failures are related to changes in the ::xpath() return code.
Comment #12
KarenS CreditAttribution: KarenS at Lullabot commentedI did some digging into this, focusing just on one test and base, the tags test:
The verbose() method doesn't work, and really throws up if you put the $xpath object in it, see issue.
Also some method names have changed:
assertEqual(): assertEquals(),
assertFalse(): assertEmpty(),
assertResponse: assertSession()->statusCodeEquals()
Comment #13
DamienMcKennaThanks Karen. After all of the recent changes we'll need to start over on the patch anyway, so your research is helpful.
Comment #14
LendudeBasic move of the top level tests (so not the sub-module ones). Lets see where the test bot fails.
I've copied the base classes and @deprecated the simpletest versions. Currently just with a doc block tag, no trigger_error.
Didn't find any ajax/fake-js emulation in here, which is nice and hopefully leaves out the really complicated conversion stuff.
Comment #16
Lendude// Use the helper functions from the Functional trait. This is pretty safe but
// remember to rewrite all of these WebTestBase tests using BrowserTestBase
// before the next millenium.
:-)
this should clear up a fair number of fails.
Comment #17
DamienMcKennaDiscussed this with @lendude in slack.
The end goal for this issue will be to not have any tests in the src/Tests directories, instead having replacements in the tests/src directories.
Let's get this into the next release.
Comment #18
LendudeHmm not sure if MetatagPageManagerTest was ever run, since it was in the wrong namespace. Might fail now that it is in the right spot.
Moved all the sub-module tests that needed moving, didn't do more then a small sample test to see if they pass, so lets see what the bot makes of this.
Comment #19
Lendude124 pass in #16, 110 pass in #18, checked the jenkins logs and both times the same set of tests is detected, so not sure what is going on here.
edit:
Using Simpletest:
Drupal\metatag_twitter_cards\Tests\MetatagTwitterCardsTagsTe 50 passes
Using BrowserTestBase:
Drupal\Tests\metatag_twitter_cards\Functional\MetatagTwitter 2 passes
As far as I can tell, there are only 2 test cases in this test class, so seems to me that the PHPUnit count is right.
Comment #20
idebr CreditAttribution: idebr at ezCompany commentedPatch applies cleanly 8.x-1.x, and converts all deprecated Simpletests to PHPUnit tests
Comment #22
DamienMcKennaThanks everyone, this has been committed!