function BookTest::generateOutlinePattern

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.

1 call to BookTest::generateOutlinePattern()
BookTest::checkBookNode in drupal/core/modules/book/lib/Drupal/book/Tests/BookTest.php
Checks the outline of sub-pages; previous, up, and next.

File

drupal/core/modules/book/lib/Drupal/book/Tests/BookTest.php, line 223
Definition of Drupal\book\Tests\BookTest.

Class

BookTest
Tests the functionality of the Book module.

Namespace

Drupal\book\Tests

Code

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