You are here

function BookTestCase::generateOutlinePattern in Drupal 7

Creates a regular expression to check for the sub-nodes in the outline.

Parameters

array $nodes: An array of nodes to check in outline.

Return value

A regular expression that locates sub-nodes of the outline.

1 call to BookTestCase::generateOutlinePattern()
BookTestCase::checkBookNode in modules/book/book.test
Checks the outline of sub-pages; previous, up, and next.

File

modules/book/book.test, line 210
Tests for book.module.

Class

BookTestCase
Tests the functionality of the Book module.

Code

function generateOutlinePattern($nodes) {
  $outline = '';
  foreach ($nodes as $node) {
    $outline .= '(node\\/' . $node->nid . ')(.*?)(' . $node->title . ')(.*?)';
  }
  return '/<div id="book-navigation-' . $this->book->nid . '"(.*?)<ul(.*?)' . $outline . '<\\/ul>/s';
}