Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
help.module
Priority:
Critical
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
16 Aug 2008 at 02:18 UTC
Updated:
2 Jan 2014 at 23:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
naxoc commentedThe only modules in core that do not implement hook_help are all in the tests folder of simpletest. If one visits /admin/help/simpletest/tests/hook_menu for instance, the SimpleTest help is displayed. So I wonder how to test with the assertion that a module does not implement hook_help. Any ideas?
Comment #2
naxoc commentedMock modules to the rescue. I used one of the existing mock modules that does not implement hook_help. I tried to test visiting the url directly, but that does not work as expected - i posted a patch suggestion in #340883: No message when no help available
Comment #3
catchThe patch should be in unified diff format, additionally hook_menu.module is now menu_test.module
Comment #4
catchComment #5
naxoc commentedNew patch uses menu_test.module and is in the right format.
Comment #6
naxoc commentedComment #7
catchCouple more things, sorry for the piecemeal review.
These should be capitalised at the beginning, with a space after the //.
Is there an existing core module which doesn't implement hook help we could use instead of menu_test?
Comment #8
naxoc commentedNo problem. Comments should be nice too. Made a new patch.
There is no core module with no hook_help. And that is good I think :) Do you think I should use one of the other modules that has more code? Here are the ones that does not implement hook_help:
find . -name *.module -print | xargs grep -L 'help()'
./modules/simpletest/tests/database_test.module
./modules/simpletest/tests/file_test.module
./modules/simpletest/tests/menu_access.module
./modules/simpletest/tests/menu_test.module
./modules/simpletest/tests/session_test.module
./modules/simpletest/tests/system_test.module
./modules/simpletest/tests/taxonomy_test.module
./modules/simpletest/tests/xmlrpc_test.module
Comment #9
naxoc commentedOh sorry, I forgot to mention that #340883: No message when no help available describe why it is not possible to test:
If the patch I posted in that issue indeed is desired behaviour, then I'll write some more test for this issue.
Comment #11
mr.baileysThanks for taking care of this naxoc! Some comments after visually inspecting the patch (haven't applied it yet):
minor: proper formatting for Doxygen comments dictates that the '*' would line up underneath the first one.
According to the same guidelines, description should end with a period. Also, the closing parenthesis is misaligned (see Coding standards). I also think 'name' is too verbose, would be great if we can trim it down a bit more.
Comments should end with a period. I also think the first sentence needs to be reworded a bit, I don't think it's grammatically correct.
I seem to have read somewhere that not having tests is a bug, not a task, so I have changed the category accordingly.
Comment #12
naxoc commentedThank you for the review mr.baileys!
I cleaned up the code, but I still did not do anything about the mock module that might implement hook_help one day.
I am not sure what to do...
Maybe a comment in the mock module with a warning? Or should I create a mock module that would not really do much apart from not implementing help? What do you think?
Comment #13
sunShorter: "No help".
"Verify no help is displayed for modules not providing any help."
Replace "mock modules" with "test modules". Remove the second comment line.
PHPDoc summaries should go on 1 line, _not_ wrapped by 80 chars. If additional description is required, add a blank line, followed by the PHPDoc description, wrapped at 80 chars.
In this case though, the summary can be shortened:
"Ensure modules not implementing help do not appear on admin/help."
Comment #14
naxoc commentedCorrected comments.
Comment #15
catchgetInfo() now needs to be
public static function getInfo()Comment #16
naxoc commentedReroll
Comment #17
catchGreat.
Comment #19
lilou commentedSetting to previous status - testbot was broken (failed to install).
Comment #21
lilou commentedNow,
t()is removed ingetinfo(): #500866: [META] remove t() from assert messageComment #22
lilou commentedComment #23
kscheirerper #500866: [META] remove t() from assert message are the t()'s for assertion description being removed too, or is that waiting until later?
Comment #24
lilou commentedhttp://drupal.org/node/500866#comment-1807364 is commited.
t()'s for assertion description being removed later.
Comment #25
kscheirerthen patch looks good.
Comment #26
webchickCommitted to HEAD. Thanks!