You are here

public function I18nBookNavigationTestCase::testIssue1619026 in Book translation 7.2

Regression test for [#1619026].

See also

http://drupal.org/node/1619026#comment-6276880

File

tests/i18n_book_navigation.test, line 501
Unit tests for the Book translation module.

Class

I18nBookNavigationTestCase

Code

public function testIssue1619026() {

  // Step 1 and 2 -> self::setUp().
  // Step 3.
  list($bid, $nodes) = $this
    ->createBookOutline();

  // Step 4.
  $fr_nodes = $this
    ->translateNodes($nodes, 'fr');

  // Step 5.
  module_enable(array(
    'i18n_menu',
    'i18n_select',
  ));
  $this
    ->resetAll();

  // Step 6.
  $this
    ->enableLanguages(array(
    'de',
  ));

  // Step 7.
  $de_nodes = $this
    ->translateNodes($nodes, 'de');

  // Step 8.
  // Check English menu links.
  $this
    ->drupalGet('node/' . $nodes[1]->nid);
  $this
    ->assertText($nodes[0]->title, "Found english root node title, from book navigation, breadcrumb and footer navigation.", 3, 'testIssue1619026');
  $this
    ->assertText($nodes[1]->title, "Found english node 1 title, from book navigation and page title.", 2, 'testIssue1619026');

  // Check French menu links.
  $this
    ->drupalGet('fr/node/' . $fr_nodes[1]->nid);
  $this
    ->assertText($fr_nodes[0]->title, "Found french root node title, from book navigation, breadcrumb and footer navigation.", 3, 'testIssue1619026');
  $this
    ->drupalGet('fr/node/' . $fr_nodes[3]->nid);
  $this
    ->assertText($fr_nodes[0]->title, "Found french root node title, from book navigation and breadcrumb.", 2, 'testIssue1619026');

  // Check German menu links.
  $this
    ->drupalGet('de/node/' . $de_nodes[1]->nid);
  $this
    ->assertText($de_nodes[0]->title, "Found german root node title, from book navigation, breadcrumb and footer navigation.", 3, 'testIssue1619026');
  $this
    ->drupalGet('de/node/' . $de_nodes[3]->nid);
  $this
    ->assertText($de_nodes[0]->title, "Found german root node title, from book navigation and breadcrumb.", 2, 'testIssue1619026');
}