Commit f10cc91a authored by webchick's avatar webchick

Issue #1811572 by xjm: Menu_test_menu() relies on the node listing callback.

parent 195d2c9d
......@@ -20,7 +20,7 @@ class RouterTest extends WebTestBase {
*
* @var array
*/
public static $modules = array('block', 'menu_test');
public static $modules = array('block', 'menu_test', 'test_page_test');
public static function getInfo() {
return array(
......@@ -62,7 +62,7 @@ function setUp() {
* Test title callback set to FALSE.
*/
function testTitleCallbackFalse() {
$this->drupalGet('node');
$this->drupalGet('test-page');
$this->assertText('A title with @placeholder', 'Raw text found on the page');
$this->assertNoText(t('A title with @placeholder', array('@placeholder' => 'some other text')), 'Text with placeholder substitutions not found.');
}
......@@ -160,7 +160,7 @@ function testMaintenanceModeLoginPaths() {
config('system.maintenance')->set('enabled', 1)->save();
$offline_message = t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => config('system.site')->get('name')));
$this->drupalGet('node');
$this->drupalGet('test-page');
$this->assertText($offline_message);
$this->drupalGet('menu_login_callback');
$this->assertText('This is menu_login_callback().', 'Maintenance mode can be bypassed through hook_menu_site_status_alter().');
......@@ -431,16 +431,16 @@ function testMenuGetItemNoAncestors() {
* Test menu_set_item().
*/
function testMenuSetItem() {
$item = menu_get_item('node');
$item = menu_get_item('test-page');
$this->assertEqual($item['path'], 'node', "Path from menu_get_item('node') is equal to 'node'", 'menu');
$this->assertEqual($item['path'], 'test-page', "Path from menu_get_item('test-page') is equal to 'test-page'", 'menu');
// Modify the path for the item then save it.
$item['path'] = 'node_test';
$item['href'] = 'node_test';
$item['path'] = 'test-page-test';
$item['href'] = 'test-page-test';
menu_set_item('node', $item);
$compare_item = menu_get_item('node');
menu_set_item('test-page', $item);
$compare_item = menu_get_item('test-page');
$this->assertEqual($compare_item, $item, 'Modified menu item is equal to newly retrieved menu item.', 'menu');
}
......@@ -466,7 +466,7 @@ function testMenuLinkOptions() {
// Create a menu link with options.
$menu_link = array(
'link_title' => 'Menu link options test',
'link_path' => 'node',
'link_path' => 'test-page',
'module' => 'menu_test',
'options' => array(
'attributes' => array(
......@@ -480,7 +480,7 @@ function testMenuLinkOptions() {
menu_link_save($menu_link);
// Load front page.
$this->drupalGet('node');
$this->drupalGet('test-page');
$this->assertRaw('title="Test title attribute"', 'Title attribute of a menu link renders.');
$this->assertRaw('testparam=testvalue', 'Query parameter added to menu link.');
}
......
......@@ -4,3 +4,4 @@ package = Testing
version = VERSION
core = 8.x
hidden = TRUE
dependencies[] = test_page_test
......@@ -56,21 +56,21 @@ function menu_test_menu() {
// Hidden link for menu_link_maintain tests
$items['menu_test_maintain/%'] = array(
'title' => 'Menu maintain test',
'page callback' => 'node_page_default',
'page callback' => 'test_page_test_page',
'access arguments' => array('access content'),
);
// Hierarchical tests.
$items['menu-test/hierarchy/parent'] = array(
'title' => 'Parent menu router',
'page callback' => 'node_page_default',
'page callback' => 'test_page_test_page',
);
$items['menu-test/hierarchy/parent/child'] = array(
'title' => 'Child menu router',
'page callback' => 'node_page_default',
'page callback' => 'test_page_test_page',
);
$items['menu-test/hierarchy/parent/child2/child'] = array(
'title' => 'Unattached subchild router',
'page callback' => 'node_page_default',
'page callback' => 'test_page_test_page',
);
// Theme callback tests.
$items['menu-test/theme-callback/%'] = array(
......@@ -106,19 +106,19 @@ function menu_test_menu() {
// change, we need to simulate our own in here.
$items['menu-test'] = array(
'title' => 'Menu test root',
'page callback' => 'node_page_default',
'page callback' => 'test_page_test_page',
'access arguments' => array('access content'),
);
$items['menu-test/hidden'] = array(
'title' => 'Hidden test root',
'page callback' => 'node_page_default',
'page callback' => 'test_page_test_page',
'access arguments' => array('access content'),
);
// Hidden tests; one dynamic argument.
$items['menu-test/hidden/menu'] = array(
'title' => 'Menus',
'page callback' => 'node_page_default',
'page callback' => 'test_page_test_page',
'access arguments' => array('access content'),
);
$items['menu-test/hidden/menu/list'] = array(
......@@ -128,20 +128,20 @@ function menu_test_menu() {
);
$items['menu-test/hidden/menu/add'] = array(
'title' => 'Add menu',
'page callback' => 'node_page_default',
'page callback' => 'test_page_test_page',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_ACTION,
);
$items['menu-test/hidden/menu/settings'] = array(
'title' => 'Settings',
'page callback' => 'node_page_default',
'page callback' => 'test_page_test_page',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK,
'weight' => 5,
);
$items['menu-test/hidden/menu/manage/%menu'] = array(
'title' => 'Customize menu',
'page callback' => 'node_page_default',
'page callback' => 'test_page_test_page',
'access arguments' => array('access content'),
);
$items['menu-test/hidden/menu/manage/%menu/list'] = array(
......@@ -152,27 +152,27 @@ function menu_test_menu() {
);
$items['menu-test/hidden/menu/manage/%menu/add'] = array(
'title' => 'Add link',
'page callback' => 'node_page_default',
'page callback' => 'test_page_test_page',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_ACTION,
);
$items['menu-test/hidden/menu/manage/%menu/edit'] = array(
'title' => 'Edit menu',
'page callback' => 'node_page_default',
'page callback' => 'test_page_test_page',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK,
'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
);
$items['menu-test/hidden/menu/manage/%menu/delete'] = array(
'title' => 'Delete menu',
'page callback' => 'node_page_default',
'page callback' => 'test_page_test_page',
'access arguments' => array('access content'),
);
// Hidden tests; two dynamic arguments.
$items['menu-test/hidden/block'] = array(
'title' => 'Blocks',
'page callback' => 'node_page_default',
'page callback' => 'test_page_test_page',
'access arguments' => array('access content'),
);
$items['menu-test/hidden/block/list'] = array(
......@@ -182,13 +182,13 @@ function menu_test_menu() {
);
$items['menu-test/hidden/block/add'] = array(
'title' => 'Add block',
'page callback' => 'node_page_default',
'page callback' => 'test_page_test_page',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_ACTION,
);
$items['menu-test/hidden/block/manage/%/%'] = array(
'title' => 'Configure block',
'page callback' => 'node_page_default',
'page callback' => 'test_page_test_page',
'access arguments' => array('access content'),
);
$items['menu-test/hidden/block/manage/%/%/configure'] = array(
......@@ -198,7 +198,7 @@ function menu_test_menu() {
);
$items['menu-test/hidden/block/manage/%/%/delete'] = array(
'title' => 'Delete block',
'page callback' => 'node_page_default',
'page callback' => 'test_page_test_page',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK,
'context' => MENU_CONTEXT_NONE,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment