5 * Test module for testing the book module.
7 * This module's functionality depends on the following state variables:
8 * - book_test.debug_book_navigation_cache_context: Used in NodeQueryAlterTest to enable the
9 * node_access_all grant realm.
11 * @see \Drupal\book\Tests\BookTest::testBookNavigationCacheContext()
15 * Implements hook_page_attachments().
17 function book_test_page_attachments(array &$page) {
18 $page['#cache']['tags'][] = 'book_test.debug_book_navigation_cache_context';
19 if (\Drupal::state()->get('book_test.debug_book_navigation_cache_context', FALSE)) {
20 drupal_set_message(\Drupal::service('cache_contexts_manager')->convertTokensToKeys(['route.book_navigation'])->getKeys()[0]);