summaryrefslogtreecommitdiff
path: root/modules/book/book.test
diff options
context:
space:
mode:
Diffstat (limited to 'modules/book/book.test')
-rw-r--r--modules/book/book.test63
1 files changed, 47 insertions, 16 deletions
diff --git a/modules/book/book.test b/modules/book/book.test
index 0006d0b0d..71dc6fe61 100644
--- a/modules/book/book.test
+++ b/modules/book/book.test
@@ -5,14 +5,37 @@
* Tests for book.module.
*/
+/**
+ * Tests the functionality of the Book module.
+ */
class BookTestCase extends DrupalWebTestCase {
+
+ /**
+ * A book node.
+ *
+ * @var object
+ */
protected $book;
- // $book_author is a user with permission to create and edit books.
+
+ /**
+ * A user with permission to create and edit books.
+ *
+ * @var object
+ */
protected $book_author;
- // $web_user is a user with permission to view a book
- // and access the printer-friendly version.
+
+ /**
+ * A user with permission to view a book and access printer-friendly version.
+ *
+ * @var object
+ */
protected $web_user;
- // $admin_user is a user with permission to create and edit books and to administer blocks.
+
+ /**
+ * A user with permission to create and edit books and to administer blocks.
+ *
+ * @var object
+ */
protected $admin_user;
public static function getInfo() {
@@ -36,7 +59,7 @@ class BookTestCase extends DrupalWebTestCase {
}
/**
- * Create a new book with a page hierarchy.
+ * Creates a new book with a page hierarchy.
*/
function createBook() {
// Create new book.
@@ -67,7 +90,7 @@ class BookTestCase extends DrupalWebTestCase {
}
/**
- * Test book functionality through node interfaces.
+ * Tests book functionality through node interfaces.
*/
function testBook() {
// Create new book.
@@ -106,18 +129,20 @@ class BookTestCase extends DrupalWebTestCase {
}
/**
- * Check the outline of sub-pages; previous, up, and next; and printer friendly version.
+ * Checks the outline of sub-pages; previous, up, and next.
+ *
+ * Also checks the printer friendly version of the outline.
*
* @param $node
* Node to check.
* @param $nodes
* Nodes that should be in outline.
* @param $previous
- * Previous link node.
+ * (optional) Previous link node. Defaults to FALSE.
* @param $up
- * Up link node.
+ * (optional) Up link node. Defaults to FALSE.
* @param $next
- * Next link node.
+ * (optional) Next link node. Defaults to FALSE.
* @param $breadcrumb
* The nodes that should be displayed in the breadcrumb.
*/
@@ -174,9 +199,13 @@ class BookTestCase extends DrupalWebTestCase {
}
/**
- * Create a regular expression to check for the sub-nodes in the outline.
+ * Creates a regular expression to check for the sub-nodes in the outline.
+ *
+ * @param array $nodes
+ * An array of nodes to check in outline.
*
- * @param array $nodes Nodes to check in outline.
+ * @return
+ * A regular expression that locates sub-nodes of the outline.
*/
function generateOutlinePattern($nodes) {
$outline = '';
@@ -188,10 +217,12 @@ class BookTestCase extends DrupalWebTestCase {
}
/**
- * Create book node.
+ * Creates a book node.
*
- * @param integer $book_nid Book node id or set to 'new' to create new book.
- * @param integer $parent Parent book reference id.
+ * @param $book_nid
+ * A book node ID or set to 'new' to create a new book.
+ * @param $parent
+ * (optional) Parent book reference ID. Defaults to NULL.
*/
function createBookNode($book_nid, $parent = NULL) {
// $number does not use drupal_static as it should not be reset
@@ -292,7 +323,7 @@ class BookTestCase extends DrupalWebTestCase {
}
/**
- * Test the book navigation block when an access module is enabled.
+ * Tests the book navigation block when an access module is enabled.
*/
function testNavigationBlockOnAccessModuleEnabled() {
$this->drupalLogin($this->admin_user);