You are here

private function ToolbarAdminMenuTest::getSubtreesHash in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php \Drupal\Tests\toolbar\Functional\ToolbarAdminMenuTest::getSubtreesHash()

Get the hash value from the admin menu subtrees route path.

Return value

string The hash value from the admin menu subtrees route path.

7 calls to ToolbarAdminMenuTest::getSubtreesHash()
ToolbarAdminMenuTest::assertDifferentHash in core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
Asserts the subtrees hash on a fresh page GET is different from the hash from the previous page GET.
ToolbarAdminMenuTest::setUp in core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
ToolbarAdminMenuTest::testLanguageSwitching in core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
Tests that subtrees hashes vary by the language of the page.
ToolbarAdminMenuTest::testLocaleTranslationSubtreesHashCacheClear in core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
Tests that toolbar cache is cleared when string translations are made.
ToolbarAdminMenuTest::testNonCurrentUserAccountUpdates in core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
Tests that changes to a user account by another user clears the changed account's toolbar cached, not the user's who took the action.

... See full list

File

core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php, line 445

Class

ToolbarAdminMenuTest
Tests the caching of the admin menu subtree items.

Namespace

Drupal\Tests\toolbar\Functional

Code

private function getSubtreesHash() {
  $settings = $this
    ->getDrupalSettings();

  // The toolbar module defines a route '/toolbar/subtrees/{hash}' that
  // returns JSON for the rendered subtrees. This hash is provided to the
  // client in drupalSettings.
  return $settings['toolbar']['subtreesHash'];
}