public function I18nBookNavigationMenuBlockTestCase::testMenuBlockIntegration in Book translation 7.2
Test menu_block integration.
File
- tests/
i18n_book_navigation.test, line 565 - Unit tests for the Book translation module.
Class
Code
public function testMenuBlockIntegration() {
if (module_enable(array(
'menu_block',
))) {
$this
->resetAll();
// Create user again - needs new permission for menu_block.
$this->admin_user = $this
->drupalCreateUser(array_keys(module_invoke_all('permission')));
$this
->drupalLogin($this->admin_user);
$this
->disableI18nBookNavigationBlock();
list($bid, $nodes) = $this
->createBookOutline();
$fr_nodes = $this
->translateNodes($nodes, 'fr');
list($bid_2, $nodes_2) = $this
->createBookOutline();
$fr_nodes_2 = $this
->translateNodes($nodes_2, 'fr');
// Add menu block.
$this
->configureAndEnableMenuBlock($nodes[0]->book['menu_name']);
// Test outline translation.
if (!empty($nodes)) {
$this
->outlineTranslationBlockVisibleOnBookPages($nodes, $nodes_2, $fr_nodes, $fr_nodes_2, 'testMenuBlockIntegration');
}
}
else {
$this
->fail("The Menu Block tests were not run, as the module could not be enabled. Make sure the Menu Block module is available.");
}
}