Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
menu system
Priority:
Critical
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Aug 2008 at 16:02 UTC
Updated:
2 Jan 2014 at 23:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ThiOz commentedHi,
Yusuf and I created a simple test for this function as part of our companies OpenAfternoon project. This code needs reviewing.
Comment #2
dsel commentedAll tests pass.
Comment #3
webchickOk, since this is a testingparty patch, I'm going to be merciless, because that helps you learn. Also, it's fun. :) Pay it forward!
I would go ahead and add this to the existing menu.inc tests, which are in modules/simpletest/tests/menu.test.
a) This line needs a sentence of PHPDoc above it explaining what's going on.
b) The class should be capitalized.
c) Also needs to be MenuSetItemTestCase.
Please preface this function with PHPDoc that says "Implementation of getInfo()."
a) Capitalize Set.
b) I would just call this 'Tests for menu_set_item()' since that's a little more clear.
Hm. Not sure that description's very useful. :) Could you be more specific? What does menu_set_item() do that's being tested?
PHPDoc please. :)
We don't abbreviate variable names. Should be $original_item. Needs to be changed throughout.
Let's simply put that string in double quotes so you don't need all the escaping.
Could we come up with values here that are a little more meaningful? Like can you think of a legitimate reason one might be changing these properties, or are you literally just throwing random stuff at it to see how it reacts?
Need a space after the comma.
Gotten isn't really a word. Let's try retrieved.
That's all I could find. :) Thanks a lot!!
Comment #4
ThiOz commentedOuch ! ... you sure are harsh, but ... okay, you were right in most cases.
The things about the random stuff is true but there are not that many cases in which I could find a use for this function, I could not even find a place where it was used in the whole Drupal code, but eventually we came up with some form use for it.
Here's the new patch, hope you like it ;)
Comment #5
dries commentedThe inline code comments in this patch are not according to the Drupal conventions. Prefix with
//and terminate your comments with a point. Almost there, ThiOz! :)Comment #6
ThiOz commentedFinally I got some time to fix these minor issues ,
here's the new patch
C Ya
Comment #7
ThiOz commentedHi
the patch made by eclipse wasn't made correctly so this one I made through the commandline
cheers
Comment #8
grndlvl commentedPatch is empty :(
Comment #9
Wisif commentedThe new patch for menu_set_item()
Comment #10
catchHi Wisif, you're missing a space in "modified for testing purposes,we "
Also, since core testing creates a completely clean drupal install and removes it once finished there's no need for 'Test:' prefixes. Otherwise this looks great. Marking to needs review to run it past the test bot.
Comment #12
dawehneri rerolled the patch and changed the stuff from here http://drupal.org/node/293511#comment-1150200
Comment #13
catchThe prefix mention should be removed from the inline comment as well.
"// To make clear this is a testnode, we prefix the title."
Comment #14
dawehnerthx for review,
i removed the previous comment and added a better description for the assert
Comment #15
catchSpotted a couple more nitpicks, sorry this is so piecemeal, rather than marking CNW I've re-rolled with the changes.
Comment #16
catchComment #17
cwgordon7 commentedEven smaller nitpick: we should be using single quotes in the second assertion, no need to use double quotes. Patch rerolled accordingly.
Comment #18
chx commentedYay more tests!
Comment #19
dries commentedCommitted to CVS HEAD. Thanks.