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.
See #2735005: Convert all Simpletest web tests to BrowserTestBase (or UnitTestBase/KernelTestBase)
Needs at least partial conversion to KernelTestBase We need to do something different then use setRawContent to test the rendered entities.
The one webtest in text module depends on \Drupal\field\Tests\String\StringFieldTest in the field module. Lets use this issue to convert these two tests which might make the field module conversion a little easier, which can't hurt.
Scope:
- \Drupal\field\Tests\String\StringFieldTest
- \Drupal\text\Tests\TextFieldTest
Comment | File | Size | Author |
---|---|---|---|
#8 | 2870462-8.patch | 4.8 KB | Lendude |
Comments
Comment #2
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedComment #3
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedComment #7
LendudeThe one webtest in the text module extends
\Drupal\field\Tests\String\StringFieldTest
.Instead of postponing on the field issue, lets just make
\Drupal\field\Tests\String\StringFieldTest
part of this issue, since its otherwise just a one test conversion.Edit: Thanks @Nick Wilde for pointing this out on Slack!
Comment #8
LendudeSo something like this. I didn't do a kernel test for the couple of times setRawContent was used because it was just checking for a string in a rendered entity which we can just do using assertContains.
Comment #9
borisson_Something like that looks great.
Comment #10
alexpottCommitted and pushed df94b0c1ef to 8.7.x and a12a80c7d3 to 8.6.x. Thanks!