1 book.test protected BookTestCase::generateOutlinePattern(array $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

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

File

core/modules/book/tests/book.test, line 233
Tests for book.module.

Class

BookTestCase
Tests the functionality of the Book module.

Code

protected function generateOutlinePattern(array $nodes) {
  $outline = '';
  foreach ($nodes as $node) {
    $outline .= '(node\/' . $node->nid . ')(.*?)(' . $node->title . ')(.*?)';
  }

  return '/<nav id="book-navigation-' . $this->book->nid . '"(.*?)<ul(.*?)' . $outline . '<\/ul>/s';
}