We need a test for menu callbacks in different files. Here's what needs to happen:

A test module needs to be created with two functions: return_hi, which just returns 'hi', and a hook_menu.
The test module needs an including one function, return_bye, which returns 'bye'.
The hook_menu needs to contain three menu items: one who's page and access calbacks are return_hi, but who's title callback is return_bye, one who's page and title callbacks are return_hi, but who's access callback is return_bye, and one who's access and title callbacks are return_hi and who's page callback is return_bye.

Then, the test needs to call all of these pages and make sure the appropriate thigns happen.

Also please think of better functoin names.

CommentFileSizeAuthor
#1 menu-331720-1.patch5.14 KBbradfordcp

Comments

bradfordcp’s picture

Component: tests » menu system
Assigned: Unassigned » bradfordcp
Status: Active » Needs review
StatusFileSize
new5.14 KB
bradfordcp’s picture

Tests currently do not pass as there is a bug within _menu_check_access() see #436940: _menu_check_access() cannot call access callback functions within include files.

Status: Needs review » Needs work

The last submitted patch failed testing.

bradfordcp’s picture

Status: Needs work » Needs review
pwolanin’s picture

Looks fine - are there any tests from the menu module test that should be moved to this new test file? If so, that can be a follow-up issue.

bradfordcp’s picture

Status: Needs review » Needs work

Adjusting the functions to better work with #296292: Menu access callbacks need a test

bradfordcp’s picture

Status: Needs work » Closed (duplicate)

Duplicate of #296292: Menu access callbacks need a test...

Test is included in the patch there