Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
menu system
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
16 Aug 2008 at 15:29 UTC
Updated:
29 Oct 2010 at 04:50 UTC
Jump to comment: Most recent file
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 commentedI am taking a look at this test this week :)
Comment #2
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 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 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 commentedRerolled the patch - it did not apply
Comment #10
kleinmp commentedHere is the patch rolled against the latest version. Hope it works.
Comment #12
naxoc commentedRolled another
Comment #13
naxoc commentedWoops. And attaching the patch
Comment #14
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 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 commentedI applied the new patch and ran the menu test again. Works fine, looks good.
Comment #18
naxoc commentedOK, I changed the string concatenation to the standard
Comment #19
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 itemsshould 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 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 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 commentedCorrected indentation and punctuation :)
Comment #31
naxoc commentedReroll
Comment #32
catchLooks good to me now.
Comment #33
dries commentedURLs should use dashes instead of underscores in Drupal.
Comment #34
naxoc commentedReplaced the underscores with dashes.
Also added an (empty) context key to the
locale_custom_strings_ento keep up with #334283: Add msgctxt-type context to t()Comment #36
lilou commentedSetting to previous status - testbot was broken (failed to install).
Comment #38
naxoc commentedReroll. I also changed a confusing call to $this->randomName() in a .module file to an ordinary static string.
Comment #40
lilou commentedHEAD is broken.
Comment #42
naxoc commentedMarking as need review to retest - I cannot make the test fail.
Comment #48
naxoc commentedReroll
Comment #49
sun.core commentedSorry, but tests don't qualify as critical anymore.
Comment #50
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 commentedReroll with the changes from #50 :)
Comment #52
Stevel commentedTestbot likes it, code looks good.
Comment #53
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 commentedSun, stop destroying the issue queue. This is a test.
Comment #56
webchickMmmm. Tests. I love tests!
Committed to HEAD. Thanks!