1 book.test BookTestCase::generateOutlinePattern($nodes)

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.:

File

core/modules/book/tests/book.test, line 202
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 '/<nav id="book-navigation-' . $this->book->nid . '"(.*?)<ul(.*?)' . $outline . '<\/ul>/s';
}