This patch attempts to address the fact that DrupalWebTestCase->assertTitle(...) will always fail due to a default site name string being appended to the title.
Specifically, it was the Node preview test that was failing, and this was the core reason.
Attached patch simply appends the string " | Drupal" to the passed-in title, and passes all current tests.
Switching the default and/or Administration themes from the GUI prior to testing has no side-effects for this patch.
| Comment | File | Size | Author |
|---|---|---|---|
| dwtc.patch | 802 bytes | BladeRider |
Comments
Comment #1
BladeRider commentedFixed spelling in topic title.
Comment #2
dries commentedIt sounds like we want to fix the callees instead, and keep assertTitle() clean. I say "won't fix".
Comment #3
BladeRider commented@Dries:
Yes, that was my first thought also before I realised that all calls to assertTitle() would have this problem. Seems that putting the burden on the callee would mean multiple possible points-of-failure.
Any other comments, or am I barking up the wrong tree here?
Comment #4
boombatower commentedSince the title may not have "| Drupal" on the end...it may have a changed site title (as a test may change) or viewing a page that doesn't append that I think it is better to force the calle to add (although inconvenient)
If anything you could add a parameter like ($title, $sufix = TRUE) and it would add the variable_get('site_name', '') or w/e and then you could turn it off if you need to, but a straight appending of the suffix is bad.
This patch by itself will cause a number of test failure since many test already append | Drupal.
Comment #6
dave reidAgreed with boombtower in #4. This needs an extra parameter, the default site name appending needs to be able to be disabled so we can test that the function fails when it should, and a patch should included changing all the calls to assertTitle or assertNoTitle in all .test files.
Comment #7
boombatower commentedDon't believe this is an issue anymore.