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.
As described on http://drupal.org/node/140311 we need four tests for the titles. I recommend using the new string overrides http://drupal.org/node/131061 to check whether t works as it should. Bonus, string overrides get tested.
Comment | File | Size | Author |
---|---|---|---|
#51 | 296115-51.patch | 3.64 KB | naxoc |
#48 | 296115_15.patch | 4.18 KB | naxoc |
#38 | 296115_14.patch | 4.13 KB | naxoc |
#34 | 296115_13.patch | 3.95 KB | naxoc |
#31 | 296115_12.patch | 4.09 KB | naxoc |
Comments
Comment #1
naxoc CreditAttribution: naxoc commentedI am taking a look at this test this week :)
Comment #2
naxoc CreditAttribution: naxoc commentedHere is a patch that tests the 4 cases in http://drupal.org/node/140311 and uses string overrides. I had to move a comment in the existing code in menu_test.module to make hook menu still make sense. I also deleted a (wrong) call to t() in a menu item.
Also, i think this test also tests #293515: TestingParty08: test 'title arguments' using t() - the test needed is the same
Comment #3
naxoc CreditAttribution: naxoc commentedComment #4
dawehneri don't like urls to issues in the documentation of a certain function
some codestyles changed in drupal7
i changed the patch ...
there should be "@" instead of "!" placeholders, because there is not html behind the placeholder
Added documenation to the helper function, but i don't understand why 3 is the default value of case_number
i changed to
added a patch
Comment #6
naxoc CreditAttribution: naxoc commentedThanks for the quick review :) I made a patch with some corrections to the doc-comment to menu_test_title_callback(). It does not use placeholders, so I changed the text.
I agree that the default 3 is a little unclear. It is to test a menu item that uses a title callback, but no title arguments (case 3). I thought that both case 3 and case 4 could use it that way.
Comment #8
naxoc CreditAttribution: naxoc commentedRerolled the patch - it did not apply
Comment #10
kleinmp CreditAttribution: kleinmp commentedHere is the patch rolled against the latest version. Hope it works.
Comment #12
naxoc CreditAttribution: naxoc commentedRolled another
Comment #13
naxoc CreditAttribution: naxoc commentedWoops. And attaching the patch
Comment #14
Brigadier CreditAttribution: Brigadier commentedPatch looks good. It applied and ran fine for me. I noticed the Group for the test results shows up as 'Other'. There's an optional parameter you could set (I assume to 'menu') for calls to assertTitle().
Comment #15
naxoc CreditAttribution: naxoc commentedThanks - fixed the group and made a function private
Comment #16
dawehnerone short stuff
the sepperation between strings in drupal7 is like this
Comment #17
Brigadier CreditAttribution: Brigadier commentedI applied the new patch and ran the menu test again. Works fine, looks good.
Comment #18
naxoc CreditAttribution: naxoc commentedOK, I changed the string concatenation to the standard
Comment #19
naxoc CreditAttribution: naxoc commentedOh.. Sorry. And forgot to remove the .txt..
Comment #20
cburschkaI really have a knack for hunting down that trailing whitespace today. :)
Tests the possible ways to set the title for menu items
should end in a period.$asserted_title . ' | Drupal'
That seems to hard-code the theme layer... is this okay here?More whitespace (the latter line multiple times).
When referring to a function in Doxygen comments, always use t() - this will cause the API generator to link to the function.
More whitespace, yay! :)
Also, "Defaults to 3" should be in parentheses rather than a separate sentence, for consistency.
Comment #21
naxoc CreditAttribution: naxoc commentedThanks Arancaytar :)
I removed whitespace and added some periods.
About
$asserted_title . ' | Drupal'
, I think it is OK for tests.Comment #22
dawehnerso just a few more tiny things.
Every comment is a sentence, so it should end with an "."
@param uses a new line for the description text.
this should have needs review
Comment #24
cburschkaI don't understand. I looked over every line of these two patches and did not see any difference that could have explained the passing of the first and the failing of the latter.
Comment #26
naxoc CreditAttribution: naxoc commentedReroll.
When applying the patch from #22, there were a few lines missing in menu_test.module, so a function disappeared.
@dereine If you edit a patch instead of generating it, please take care when adding lines - it breaks the patch. The safer way is to apply the patch, make changes, and make a new patch.
Comment #27
cburschkaAh, yes. I've tried that occasionally because it seemed so deceptively simple - but ultimately, the line numbers and offsets bit me. This patch format is more complex than it seems, and while it is human-readable very easily, it is not human-writable by any means.
Comment #28
dawehneryes i edit just the patch :( my fault
is missing the .
And:
should be
Comment #29
naxoc CreditAttribution: naxoc commentedCorrected indentation and punctuation :)
Comment #31
naxoc CreditAttribution: naxoc commentedReroll
Comment #32
catchLooks good to me now.
Comment #33
Dries CreditAttribution: Dries commentedURLs should use dashes instead of underscores in Drupal.
Comment #34
naxoc CreditAttribution: naxoc commentedReplaced the underscores with dashes.
Also added an (empty) context key to the
locale_custom_strings_en
to keep up with #334283: Add msgctxt-type context to t()Comment #36
lilou CreditAttribution: lilou commentedSetting to previous status - testbot was broken (failed to install).
Comment #38
naxoc CreditAttribution: naxoc commentedReroll. I also changed a confusing call to $this->randomName() in a .module file to an ordinary static string.
Comment #40
lilou CreditAttribution: lilou commentedHEAD is broken.
Comment #42
naxoc CreditAttribution: naxoc commentedMarking as need review to retest - I cannot make the test fail.
Comment #48
naxoc CreditAttribution: naxoc commentedReroll
Comment #49
sun.core CreditAttribution: sun.core commentedSorry, but tests don't qualify as critical anymore.
Comment #50
Stevel CreditAttribution: Stevel commentedcode style issue: the 3 last lines should be indented one space, so the asterisks are aligned. Same goes for the other comments.
trailing whitespace
trailing whitespace
Looks good from a functionality perspective.
Comment #51
naxoc CreditAttribution: naxoc commentedReroll with the changes from #50 :)
Comment #52
Stevel CreditAttribution: Stevel commentedTestbot likes it, code looks good.
Comment #53
naxoc CreditAttribution: naxoc commented#51: 296115-51.patch queued for re-testing.
Comment #54
sunAlthough badly needed, this is D8 material according to the rules (I had to learn today). It may be backported at a later point in time (though that's unlikely).
Comment #55
chx CreditAttribution: chx commentedSun, stop destroying the issue queue. This is a test.
Comment #56
webchickMmmm. Tests. I love tests!
Committed to HEAD. Thanks!