public function I18nBookNavigationTestCase::testCoreLogic in Book translation 7.2
Test core logic.
File
- tests/
i18n_book_navigation.test, line 446 - Unit tests for the Book translation module.
Class
Code
public function testCoreLogic() {
// Create 2 books.
list(, $nodes) = $this
->createBookOutline();
$this
->translateNodes($nodes, 'fr');
list(, $nodes_2) = $this
->createBookOutline();
$this
->translateNodes($nodes_2, 'fr');
$num_books = count(book_get_books());
$this
->drupalGet('/node');
$this
->assertEqual(count(i18n_book_navigation_get_books()), $num_books, "Find the same number of books when in english ({$num_books} books).", 'testCoreLogic');
$this
->drupalGet('/fr/node');
$this
->assertEqual(count(i18n_book_navigation_get_books()), $num_books, "Find the same number of books when in french ({$num_books} books).", 'testCoreLogic');
}