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.
While working on #1806334: Replace the node listing at /node with a view, I noticed that LocaleContentTest only uses the standard profile because it needs two content types.
By just creating content types when needed, it halved the test run times.
Comment | File | Size | Author |
---|---|---|---|
#19 | locale-1812170-19.patch | 9.9 KB | xjm |
#16 | locale-1812170-16.patch | 9.87 KB | xjm |
#16 | locale-interdiff-16.txt | 714 bytes | xjm |
#12 | locale-1812170-12.patch | 9.17 KB | xjm |
#10 | locale-only-1812170-10.patch | 9.17 KB | xjm |
Comments
Comment #2
tim.plunkettSee attached.
Comment #3
xjmExcellent patch.
Maybe we can remove this helper entirely, and instead add an optional
$langcode
parameter todrupalCreateNode()
? Edit: Or just makedrupalCreateNode()
use the langcode provided when generating a random body.Comment #4
xjmComment #5
xjmDiscussed with @tim.plunkett in IRC; I'll add something along the lines of #3.
Comment #6
xjmAttached:
WebTestBase::drupalCreateNode()
to automatically use the provided langcode when generating a body. (This can of course be overridden.)WebTestBase::drupalCreateNode()
while I'm at it.LocaleContentTest
to get rid of the superfluous helper and just usedrupalCreateNode()
directly.t()
from the assertions in the updated methods since this is going to collide with #1797364: Remove t() from assertion messages in tests for the locale module anyway.Didn't test it locally; I don't yet guarantee there are no typos. ;)
Comment #8
xjmOh. Looking more closely, these lines might not actually be correct. Down below it does this:
Comment #9
xjmAnd indeed there was a typo:
Comment #10
xjmSo, two versions; one includes the change to
drupalCreateNode()
; the other does not. Let's see if there's any difference as far as tests are concerned.Comment #12
xjmSo that answers that question.
Comment #15
xjmThere we go.
Filed #1812732: Use constants instead of integers in drupalCreateNode() and improve its documentation for the earlier cleanups and to better document the behavior with the langcodes.
Comment #16
xjmEr. Where did you go, patch? Re-uploading...
Comment #17
chx CreditAttribution: chx commentedThat looks good.
Comment #18
webchickYay, faster and more generally useful tests!
Boo, doesn't apply. ;(
Comment #19
xjmJust a rebase.
Comment #20
webchickYay! Committed and pushed to 8.x.
Comment #21
tim.plunkettHmm were you sure this was going to pass? Testbot has been running for over an hour due to the commits, without finishing once.