function BookTestCase::createBook
Creates a new book with a page hierarchy.
10 calls to BookTestCase::createBook()
- BookTestCase::testBook in drupal-7.x/
modules/ book/ book.test - Tests book functionality through node interfaces.
- BookTestCase::testBook in drupal-7.x/
modules/ book/ book.test - Tests book functionality through node interfaces.
- BookTestCase::testBookDelete in drupal-7.x/
modules/ book/ book.test - Tests the access for deleting top-level book nodes.
- BookTestCase::testBookDelete in drupal-7.x/
modules/ book/ book.test - Tests the access for deleting top-level book nodes.
- BookTestCase::testBookExport in drupal-7.x/
modules/ book/ book.test - Tests book export ("printer-friendly version") functionality.
Archivo
- drupal-7.x/
modules/ book/ book.test, line 64 - Tests for book.module.
Class
- BookTestCase
- Tests the functionality of the Book module.
Código
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;
}