From 25171a17f626695ecf984cc44b60d3eae1310b4c Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Thu, 5 Aug 2010 23:53:39 +0000 Subject: Reverting #500866. Needs more discussion. --- modules/menu/menu.test | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'modules/menu') diff --git a/modules/menu/menu.test b/modules/menu/menu.test index a050fd90c..d1b822699 100644 --- a/modules/menu/menu.test +++ b/modules/menu/menu.test @@ -71,7 +71,7 @@ class MenuTestCase extends DrupalWebTestCase { $item['options']['attributes']['title'] = $description; menu_link_save($item); $saved_item = menu_link_load($item['mlid']); - $this->assertEqual($description, $saved_item['options']['attributes']['title'], 'Saving an existing link updates the description (title attribute)'); + $this->assertEqual($description, $saved_item['options']['attributes']['title'], t('Saving an existing link updates the description (title attribute)')); $this->resetMenuLink($item, $old_title); } @@ -112,14 +112,14 @@ class MenuTestCase extends DrupalWebTestCase { // Assert the new menu. $this->drupalGet('admin/structure/menu/manage/' . $menu_name . '/edit'); - $this->assertText($title, 'Custom menu was added.'); + $this->assertText($title, t('Custom menu was added.')); // Edit the menu. $new_title = $this->randomName(16); $menu['title'] = $new_title; menu_save($menu); $this->drupalGet('admin/structure/menu/manage/' . $menu_name . '/edit'); - $this->assertText($new_title, 'Custom menu was edited.'); + $this->assertText($new_title, t('Custom menu was edited.')); } /** @@ -140,7 +140,7 @@ class MenuTestCase extends DrupalWebTestCase { $this->drupalPost('admin/structure/menu/add', $edit, t('Save')); // Verify that using a menu_name that is too long results in a validation message. - $this->assertText(format_plural(MENU_MAX_MENU_NAME_LENGTH_UI, "The menu name can't be longer than 1 character.", "The menu name can't be longer than @count characters."), 'Validation failed when menu name is too long.'); + $this->assertText(format_plural(MENU_MAX_MENU_NAME_LENGTH_UI, "The menu name can't be longer than 1 character.", "The menu name can't be longer than @count characters."), t('Validation failed when menu name is too long.')); // Change the menu_name so it no longer exceeds the maximum length. $menu_name = substr(hash('sha256', $this->randomName(16)), 0, MENU_MAX_MENU_NAME_LENGTH_UI); @@ -148,7 +148,7 @@ class MenuTestCase extends DrupalWebTestCase { $this->drupalPost('admin/structure/menu/add', $edit, t('Save')); // Verify that no validation error is given for menu_name length. - $this->assertNoText(format_plural(MENU_MAX_MENU_NAME_LENGTH_UI, "The menu name can't be longer than 1 character.", "The menu name can't be longer than @count characters."), 'Validation failed when menu name is too long.'); + $this->assertNoText(format_plural(MENU_MAX_MENU_NAME_LENGTH_UI, "The menu name can't be longer than 1 character.", "The menu name can't be longer than @count characters."), t('Validation failed when menu name is too long.')); // Unlike most other modules, there is no confirmation message displayed. $this->drupalGet('admin/structure/menu'); @@ -160,7 +160,7 @@ class MenuTestCase extends DrupalWebTestCase { $edit['menu_' . $menu_name . '[region]'] = 'sidebar_first'; $this->drupalPost('admin/structure/block', $edit, t('Save blocks')); $this->assertResponse(200); - $this->assertText(t('The block settings have been updated.'), 'Custom menu block was enabled'); + $this->assertText(t('The block settings have been updated.'), t('Custom menu block was enabled')); return menu_load($menu_name); } @@ -177,11 +177,11 @@ class MenuTestCase extends DrupalWebTestCase { // Delete custom menu. $this->drupalPost("admin/structure/menu/manage/$menu_name/delete", array(), t('Delete')); $this->assertResponse(200); - $this->assertRaw(t('The custom menu %title has been deleted.', array('%title' => $title)), 'Custom menu was deleted'); + $this->assertRaw(t('The custom menu %title has been deleted.', array('%title' => $title)), t('Custom menu was deleted')); $this->assertFalse(menu_load($menu_name), 'Custom menu was deleted'); // Test if all menu links associated to the menu were removed from database. $result = db_query("SELECT menu_name FROM {menu_links} WHERE menu_name = :menu_name", array(':menu_name' => $menu_name))->fetchField(); - $this->assertFalse($result, 'All menu links associated to the custom menu were deleted.'); + $this->assertFalse($result, t('All menu links associated to the custom menu were deleted.')); } /** @@ -220,7 +220,7 @@ class MenuTestCase extends DrupalWebTestCase { // Verify in the database. $hidden = db_query("SELECT hidden FROM {menu_links} WHERE mlid = :mlid", array(':mlid' => $item1['mlid']))->fetchField(); - $this->assertEqual($hidden, 0, 'Link is not hidden in the database table when enabled via the overview form'); + $this->assertEqual($hidden, 0, t('Link is not hidden in the database table when enabled via the overview form')); // Save menu links for later tests. $this->items[] = $item1; @@ -238,13 +238,13 @@ class MenuTestCase extends DrupalWebTestCase { $item = $this->addMenuLink(0, $path); $this->drupalGet('admin/structure/menu/item/' . $item['mlid'] . '/edit'); - $this->assertFieldByName('link_path', $path, 'Path is found with both query and fragment.'); + $this->assertFieldByName('link_path', $path, t('Path is found with both query and fragment.')); // Now change the path to something without query and fragment. $path = 'node'; $this->drupalPost('admin/structure/menu/item/' . $item['mlid'] . '/edit', array('link_path' => $path), t('Save')); $this->drupalGet('admin/structure/menu/item/' . $item['mlid'] . '/edit'); - $this->assertFieldByName('link_path', $path, 'Path no longer has query or fragment.'); + $this->assertFieldByName('link_path', $path, t('Path no longer has query or fragment.')); } /** @@ -345,7 +345,7 @@ class MenuTestCase extends DrupalWebTestCase { // Verify menu link link. $this->clickLink($title); $title = $parent_node->title; - $this->assertTitle(t("@title | Drupal", array('@title' => $title)), 'Parent menu link link target was correct'); + $this->assertTitle(t("@title | Drupal", array('@title' => $title)), t('Parent menu link link target was correct')); } // Verify menu link. @@ -355,7 +355,7 @@ class MenuTestCase extends DrupalWebTestCase { // Verify menu link link. $this->clickLink($title); $title = $item_node->title; - $this->assertTitle(t("@title | Drupal", array('@title' => $title)), 'Menu link link target was correct'); + $this->assertTitle(t("@title | Drupal", array('@title' => $title)), t('Menu link link target was correct')); } /** @@ -394,7 +394,7 @@ class MenuTestCase extends DrupalWebTestCase { // Reset menu link. $this->drupalPost("admin/structure/menu/item/$mlid/reset", array(), t('Reset')); $this->assertResponse(200); - $this->assertRaw(t('The menu link was reset to its default settings.'), 'Menu link was reset'); + $this->assertRaw(t('The menu link was reset to its default settings.'), t('Menu link was reset')); // Verify menu link. $this->drupalGet(''); @@ -414,7 +414,7 @@ class MenuTestCase extends DrupalWebTestCase { // Delete menu link. $this->drupalPost("admin/structure/menu/item/$mlid/delete", array(), t('Confirm')); $this->assertResponse(200); - $this->assertRaw(t('The menu link %title has been deleted.', array('%title' => $title)), 'Menu link was deleted'); + $this->assertRaw(t('The menu link %title has been deleted.', array('%title' => $title)), t('Menu link was deleted')); // Verify deletion. $this->drupalGet(''); @@ -454,7 +454,7 @@ class MenuTestCase extends DrupalWebTestCase { // Unlike most other modules, there is no confirmation message displayed. // Verify in the database. $hidden = db_query("SELECT hidden FROM {menu_links} WHERE mlid = :mlid", array(':mlid' => $mlid))->fetchField(); - $this->assertEqual($hidden, 1, 'Link is hidden in the database table'); + $this->assertEqual($hidden, 1, t('Link is hidden in the database table')); } /** @@ -470,7 +470,7 @@ class MenuTestCase extends DrupalWebTestCase { // Verify in the database. $hidden = db_query("SELECT hidden FROM {menu_links} WHERE mlid = :mlid", array(':mlid' => $mlid))->fetchField(); - $this->assertEqual($hidden, 0, 'Link is not hidden in the database table'); + $this->assertEqual($hidden, 0, t('Link is not hidden in the database table')); } /** @@ -497,21 +497,21 @@ class MenuTestCase extends DrupalWebTestCase { $this->drupalGet('admin/help/menu'); $this->assertResponse($response); if ($response == 200) { - $this->assertText(t('Menu'), 'Menu help was displayed'); + $this->assertText(t('Menu'), t('Menu help was displayed')); } // View menu build overview node. $this->drupalGet('admin/structure/menu'); $this->assertResponse($response); if ($response == 200) { - $this->assertText(t('Menus'), 'Menu build overview node was displayed'); + $this->assertText(t('Menus'), t('Menu build overview node was displayed')); } // View navigation menu customization node. $this->drupalGet('admin/structure/menu/manage/navigation'); - $this->assertResponse($response); + $this->assertResponse($response); if ($response == 200) { - $this->assertText(t('Navigation'), 'Navigation menu node was displayed'); + $this->assertText(t('Navigation'), t('Navigation menu node was displayed')); } // View menu edit node. @@ -519,21 +519,21 @@ class MenuTestCase extends DrupalWebTestCase { $this->drupalGet('admin/structure/menu/item/' . $item['mlid'] . '/edit'); $this->assertResponse($response); if ($response == 200) { - $this->assertText(t('Edit menu item'), 'Menu edit node was displayed'); + $this->assertText(t('Edit menu item'), t('Menu edit node was displayed')); } // View menu settings node. $this->drupalGet('admin/structure/menu/settings'); $this->assertResponse($response); if ($response == 200) { - $this->assertText(t('Menus'), 'Menu settings node was displayed'); + $this->assertText(t('Menus'), t('Menu settings node was displayed')); } // View add menu node. $this->drupalGet('admin/structure/menu/add'); $this->assertResponse($response); if ($response == 200) { - $this->assertText(t('Menus'), 'Add menu node was displayed'); + $this->assertText(t('Menus'), t('Add menu node was displayed')); } } } @@ -614,7 +614,7 @@ class MenuNodeTestCase extends DrupalWebTestCase { $this->assertLink($node_title); $this->drupalGet('node/' . $node->nid . '/edit'); - $this->assertOptionSelected('edit-menu-weight', 17, 'Menu weight correct in edit form'); + $this->assertOptionSelected('edit-menu-weight', 17, t('Menu weight correct in edit form')); // Edit the node and remove the menu link. $edit = array( -- cgit v1.2.3