91da82c28923010a93585dacb67ecf3386ab62d0
[yaffs-website] / web / core / modules / book / tests / modules / book_test / book_test.module
1 <?php
2
3 /**
4  * @file
5  * Test module for testing the book module.
6  *
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.
10  *
11  * @see \Drupal\book\Tests\BookTest::testBookNavigationCacheContext()
12  */
13
14 /**
15  * Implements hook_page_attachments().
16  */
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::messenger()->addStatus(\Drupal::service('cache_contexts_manager')->convertTokensToKeys(['route.book_navigation'])->getKeys()[0]);
21   }
22 }