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).
In scope:
ResourceTest
ExcludedFieldTokenTest
(out-of-scope till #2863267: Convert web tests of views lands— landed!)StyleSerializerTest
(out-of-scope till #2863267: Convert web tests of views lands— landed!)
Out-of-scope based on #2808777: Research: Complex tests to convert — these 4 tests are all UpdatePathTestBase
tests:
EntityResourcePermissionsUpdateTest
ResourceGranularityUpdateTest
RestConfigurationEntitiesUpdateTest
RestExportAuthUpdateTest
Comment | File | Size | Author |
---|---|---|---|
#25 | 2775553-25.patch | 25.83 KB | Wim Leers |
Comments
Comment #2
xjmGoing forward, let's please stop doing individual module conversions and do larger chunks at once. See #2770921: Feb 21st: Convert chunk of WTB to BTB by just moving classes, changing use statements adding traits and https://www.drupal.org/core/scope#incomplete.
Comment #3
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedThere are still WebTests in rest after the big bang, reopening the issue.
Comment #4
Wim LeersYou're right, in the deprecated
\Drupal\rest\Tests\RESTTestBase
and its subclasses.Comment #5
LendudeTook a quick look at
\Drupal\rest\Tests\ResourceTest
but that will require more then a quick look :)Updated the IS to set some scope on this conversion
Comment #6
dawehnerI'm wondering whether this case is the chance for us to provide a ApiTestBase, aka. something which provides methods like:
$this->request()
On the other hand I believe we should just convert the test over, given that we have a MUCH better test coverage in phpunit already.
Comment #7
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedComment #8
Wim Leers#2863267: Convert web tests of views landed.
Here's a start.
Comment #9
Wim LeersComment #10
Wim LeersNow the IS reflects the actual scope & status.
Comment #11
Wim LeersAlso doing
StyleSerializerTest
. Just one last failure…Comment #12
dawehnerStyleSerializerTest
That test takes sooooooooooo much time.Comment #13
Wim LeersCompleted
StyleSerializerTest
.Now working on the last one.
Comment #14
Wim LeersThis should be green.
Comment #15
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedDid a quick code review and it looks good! Haven't found anything yet.
I think it's a good thing base classes are dropped. It does make the test a little less magical.
Comment #16
Wim Leers#15, that, and
RESTTestBase
is already deprecated anyway:Comment #17
naveenvalechaShall we also convert the RESTTestBase dependent tests also as the part of this and close this one as duplicate #2889882: Convert ResponseGeneratorTest, DbLogResourceTest, RestRegisterUserTest to BTB
Comment #18
Wim LeersNo, I'd rather get this in separately — that'd mean progress! I think #2889882: Convert ResponseGeneratorTest, DbLogResourceTest, RestRegisterUserTest to BTB will be a bit more painful.
Comment #19
Wim LeersComment #20
naveenvalechaLet's move the new tests to their namespace. Changes look good on local.
#18, That's fine. Removed ResourceTest from here #2889882: Convert ResponseGeneratorTest, DbLogResourceTest, RestRegisterUserTest to BTB
//Naveen
Comment #21
Wim Leers+1
So… is this then RTBC? (@naveenvalecha, just moving files doesn't mean you can't RTBC anymore.)
Comment #22
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedDid another review pass, everything looks good. Setting to RTBC!
Comment #23
naveenvalechaRTBC +1
#16 +1 It's good to leave deprecated RESTTestBase where it is. Let's RESTTestBase child classes(ResponseGeneratorTest, DbLogResourceTest, RestRegisterUserTest) use the BTB directly.
//Naveen
Comment #24
dawehnerI agree, we have followed that strategy in multiple places.
These constants are nice!
These are two instances where we switched to use
assertSame
, but we have the wrong order. Let's not introduce a small regression here.Comment #25
Wim LeersFixed #24.2.
Comment #26
dawehnerThank you @Wim Leers!
Comment #29
catchCommitted/pushed to 8.5.x and cherry-picked to 8.4.x. Thanks!
Comment #31
Wim Leers🎉