Creates a new book with a page hierarchy.
function createBook() {
// Create new book.
$this
->drupalLogin($this->book_author);
$this->book = $this
->createBookNode('new');
$book = $this->book;
/*
* Add page hierarchy to book.
* Book
* |- Node 0
* |- Node 1
* |- Node 2
* |- Node 3
* |- Node 4
*/
$nodes = array();
$nodes[] = $this
->createBookNode($book->nid);
// Node 0.
$nodes[] = $this
->createBookNode($book->nid, $nodes[0]->book['mlid']);
// Node 1.
$nodes[] = $this
->createBookNode($book->nid, $nodes[0]->book['mlid']);
// Node 2.
$nodes[] = $this
->createBookNode($book->nid);
// Node 3.
$nodes[] = $this
->createBookNode($book->nid);
// Node 4.
$this
->drupalLogout();
return $nodes;
}