You are here

function EntityTranslationMenuTranslationTestCase::editPage in Entity Translation 7

Edit a page menu item.

Check that node form contains old menu link title, then replace with given new title.

3 calls to EntityTranslationMenuTranslationTestCase::editPage()
EntityTranslationMenuTranslationTestCase::testMenuLocalization in entity_translation_i18n_menu/entity_translation_i18n_menu.test
Test if menu localization works.
EntityTranslationMenuTranslationTestCase::testMenuLocalizationCustomSourceLanguage in entity_translation_i18n_menu/entity_translation_i18n_menu.test
Test if menu localization works (source language != default language).
EntityTranslationMenuTranslationTestCase::testMenuTranslation in entity_translation_i18n_menu/entity_translation_i18n_menu.test
Test if menu translation works with separate menu items.

File

entity_translation_i18n_menu/entity_translation_i18n_menu.test, line 113
Tests for Entity translation module.

Class

EntityTranslationMenuTranslationTestCase
Tests for the translation of menu items on entity forms.

Code

function editPage($node, $old_link_title, $link_title, $langcode) {
  $this
    ->drupalGet('node/' . $node->nid . '/edit/' . $langcode);
  $this
    ->assertFieldByXPath("//input[@name='menu[link_title]']", $old_link_title, 'Old link title value correctly populated: ' . $old_link_title);
  $edit = array();
  $edit['menu[link_title]'] = $link_title;
  $this
    ->drupalPost(NULL, $edit, t('Save'));

  // Check to make sure menu link was updated.
  $this
    ->get($langcode, '<front>');
  $this
    ->assertNoText($old_link_title, 'Old menu link title not found: ' . $old_link_title);
  $this
    ->assertText($link_title, 'New menu link title found: ' . $link_title);
}