function ToolbarAdminMenuTest::getSubtreesHash

Same name in other branches
  1. 9 core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php \Drupal\Tests\toolbar\Functional\ToolbarAdminMenuTest::getSubtreesHash()
  2. 10 core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php \Drupal\Tests\toolbar\Functional\ToolbarAdminMenuTest::getSubtreesHash()
  3. 11.x 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
Test 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 421

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'];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.