You are here

protected function I18nBookNavigationTestBase::outlineTranslationBlockVisibleOnBookPages in Book translation 7.2

Test outline translation with the book block visible on only BOOK pages.

3 calls to I18nBookNavigationTestBase::outlineTranslationBlockVisibleOnBookPages()
I18nBookNavigationMenuBlockTestCase::testMenuBlockIntegration in tests/i18n_book_navigation.test
Test menu_block integration.
I18nBookNavigationPanelsTestCase::testPanelsIntegration in tests/i18n_book_navigation.test
Test panels integration.
I18nBookNavigationTestBase::outlineTranslation in tests/i18n_book_navigation.test
Test outline translations.

File

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

Class

I18nBookNavigationTestBase
@file Unit tests for the Book translation module.

Code

protected function outlineTranslationBlockVisibleOnBookPages($nodes, $nodes_2, $fr_nodes, $fr_nodes_2, $group = 'Other') {
  variable_set('book_block_mode', 'book pages');

  // Check menu links. Should be found 2 or 3 times each time:
  // - once in the block
  // - once in the breadcrumb
  // - one or zero times in the footer navigation
  // Check English menu links.
  $this
    ->drupalGet('node/' . $nodes[1]->nid);
  $this
    ->assertText($nodes[0]->title, "Found english book 1 root node title, from book navigation, breadcrumb and footer navigation.", 3, $group);
  $this
    ->assertNoText($nodes_2[0]->title, "Found no english book 2 root node title, from book navigation.", $group);
  $this
    ->drupalGet('node/' . $nodes[3]->nid);
  $this
    ->assertText($nodes[0]->title, "Found english book 1 root node title ({$nodes[0]->title}), from book navigation and breadcrumb.", 2, $group);
  $this
    ->assertNoText($nodes_2[0]->title, "Found no english book 2 root node title ({$nodes_2[0]->title}), from book navigation.", $group);
  $this
    ->assertText($nodes[1]->title, "Found english book 1 node 1 title ({$nodes[1]->title}), from book navigation and breadcrumb.", 2, $group);
  $this
    ->assertText($nodes[2]->title, "Found english book 1 node 2 title ({$nodes[2]->title}), from book navigation and footer navigation.", 2, $group);
  $this
    ->assertText($nodes[4]->title, "Found english book 1 node 4 title ({$nodes[4]->title}), from book navigation and footer navigation.", 2, $group);
  $this
    ->assertText($nodes[5]->title, "Found english book 1 node 5 title ({$nodes[5]->title}), from book navigation.", 1, $group);

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