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.
Part of meta #1811016: [meta] Decouple tests from Node module.
PageCacheTest
is yet another module that uses the node module just to check for a valid, rendered front page. I realized that making all these tests rely on user
instead doesn't address the root problem. We need a reliable test page that always has the same test title and content, decoupled from any actual module.
See previous issues:
Comment | File | Size | Author |
---|---|---|---|
#18 | 1811804-18-test-page-test-page-title.patch | 988 bytes | tstoeckler |
#15 | 1811804-15-test-page-test-page-title.patch | 923 bytes | tstoeckler |
#12 | drupal-1811804-12.patch | 9.82 KB | xjm |
#12 | interdiff.txt | 718 bytes | xjm |
#6 | drupal-1811804-6.patch | 9.83 KB | xjm |
Comments
Comment #1
xjmClosed #1811622: Remove assumption about front page title from NodeCreationTest in favor of this issue; adding that. I'll look for others as well.
Comment #2
xjmComment #3
xjmMenuTest
may be another place to use this.Comment #5
xjmThis needs to go in
$modules
.Comment #6
xjmFixed here. I checked and
MenuTest
probably wants to move away from a standard profile dependency, so leaving that out for now.Comment #8
xjmThe fail above looked unrelated so I retested.
Related issue: #1811792: drupal_set_title() should not be necessary to set the homepage title
Comment #9
xjmComment #10
tim.plunkettThis is much better than just arbitrarily checking 'user' or 'node' in different cases.
Comment #11
Lars Toomre CreditAttribution: Lars Toomre commentedOverall this looks good @xjm. I will leave it as is for others to concur.
Small nit if this gets re-rolled. This in-line comment needs to be adjusted. This was a copy and paste from below.
Comment #12
xjmComment #13
Lars Toomre CreditAttribution: Lars Toomre commentedAssuming this comes back green, given #10, RTBC!
Comment #14
webchickThis looks good to me. Might be a tad bit more performant too, if we start making use of this test module widely wherever we actually mean "did a page come back ok?"
Committed and pushed to 8.x. I am going to go out on a limb and say testbot will not have anymore failures over a docs change than it did before (random fails notwithstanding).
Comment #15
tstoecklerAwesome patch!
I had the same strange feeling when seeing the 'node' -> 'user' replacements.
One little thing:
I find the usage of drupal_set_title() very confusing here, and, unless I'm missing something, completely unnecessary.
Quick patch to remove that.
I think 'Test page' is more accurate than 'Test front page' as that depends on the usage.
Comment #16
xjmIt is necessary; see #1811792: drupal_set_title() should not be necessary to set the homepage title.
Comment #17
vegabajalakes13 CreditAttribution: vegabajalakes13 commented#6: drupal-1811804-6.patch queued for re-testing.
Comment #18
tstoecklerOh, I didn't know about that. Thanks! How about this one, then?:
Comment #19
vegabajalakes13 CreditAttribution: vegabajalakes13 commented#6: drupal-1811804-6.patch queued for re-testing.
Comment #20
vegabajalakes13 CreditAttribution: vegabajalakes13 commented1811804-6.patch-PageCacheTest module. Retest complete, test passed twice #17 and #19.
Comment #21
xjmLooks good to me.
Comment #22
webchickI'm confused by that comment? It seems to be linking back to this issue?
Comment #23
webchickOk, right. So that was apparently just a copy/paste error cos the real link is over here #1811792: drupal_set_title() should not be necessary to set the homepage title.
xjm and I spoke about this, and since that issue needs tests anyway, rather than committing this as a temporary stop-gap, let's just make this change in that issue and assert that the title is set. Two birds, one patch. :D
Marking back to 'fixed' for the patch in #12.
Comment #24
xjmComment #25.0
(not verified) CreditAttribution: commentedUpdated issue summary.