diff --git a/core/modules/book/src/Tests/BookBreadcrumbTest.php b/core/modules/book/src/Tests/BookBreadcrumbTest.php index 2c126aa..49a88ca 100644 --- a/core/modules/book/src/Tests/BookBreadcrumbTest.php +++ b/core/modules/book/src/Tests/BookBreadcrumbTest.php @@ -190,8 +190,8 @@ public function testBreadcrumbAccessUpdates() { } $this->assertEqual(5, count($got_breadcrumb)); $this->assertEqual($edit['title[0][value]'], end($got_breadcrumb)); - $config = $this->container->get('config.factory')->getEditable('book_breadcrumb_test.settings'); - $config->set('hide', TRUE)->save(); + $this->container->get('state')->set('book_breadcrumb_test_hide', 1); + $this->container->get('cache_tags.invalidator')->invalidateTags(['book_breadcrumb_test']); $this->drupalGet($nodes[4]->toUrl()); $links = $this->xpath('//nav[@class="breadcrumb"]/ol/li/a'); $got_breadcrumb = array(); diff --git a/core/modules/book/tests/modules/book_breadcrumb_test/book_breadcrumb_test.module b/core/modules/book/tests/modules/book_breadcrumb_test/book_breadcrumb_test.module index 63c3c52..43b1c27 100644 --- a/core/modules/book/tests/modules/book_breadcrumb_test/book_breadcrumb_test.module +++ b/core/modules/book/tests/modules/book_breadcrumb_test/book_breadcrumb_test.module @@ -14,13 +14,13 @@ * Implements hook_node_access(). */ function book_breadcrumb_test_node_access(NodeInterface $node, $operation, AccountInterface $account) { - $config = \Drupal::config('book_breadcrumb_test.settings'); - if ($config->get('hide') && $node->getTitle() == "you can't see me" && $operation == 'view') { + if (\Drupal::state()->get('book_breadcrumb_test_hide') && $node->getTitle() == "you can't see me" && $operation == 'view') { $access = new AccessResultForbidden(); } else { $access = new AccessResultNeutral(); } - $access->addCacheableDependency($config); + $access->addCacheTags(['book_breadcrumb_test']); + $access->addCacheableDependency($node); return $access; }