You are here

function ToolbarAdminMenuTest::testMenuLinkUpdateSubtreesHashCacheClear in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php \Drupal\toolbar\Tests\ToolbarAdminMenuTest::testMenuLinkUpdateSubtreesHashCacheClear()

Tests toolbar cache tags implementation.

File

core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php, line 132
Contains \Drupal\toolbar\Tests\ToolbarAdminMenuTest.

Class

ToolbarAdminMenuTest
Tests the caching of the admin menu subtree items.

Namespace

Drupal\toolbar\Tests

Code

function testMenuLinkUpdateSubtreesHashCacheClear() {

  // The ID of a (any) admin menu link.
  $admin_menu_link_id = 'system.admin_config_development';

  // Disable the link.
  $edit = array();
  $edit['enabled'] = FALSE;
  $this
    ->drupalPostForm("admin/structure/menu/link/" . $admin_menu_link_id . "/edit", $edit, t('Save'));
  $this
    ->assertResponse(200);
  $this
    ->assertText('The menu link has been saved.');

  // Assert that the subtrees hash has been altered because the subtrees
  // structure changed.
  $this
    ->assertDifferentHash();
}