function LinksetControllerTestBase::enableEndpoint

Same name in other branches
  1. 11.x core/modules/system/tests/src/Functional/Menu/LinksetControllerTestBase.php \Drupal\Tests\system\Functional\Menu\LinksetControllerTestBase::enableEndpoint()

Enables or disables the menu linkset endpoint.

Parameters

bool $enabled: Whether the endpoint should be enabled.

5 calls to LinksetControllerTestBase::enableEndpoint()
LinksetControllerTest::testAccess in core/modules/system/tests/src/Functional/Menu/LinksetControllerTest.php
Test the access control functionality of the linkset endpoint.
LinksetControllerTest::testBasicFunctions in core/modules/system/tests/src/Functional/Menu/LinksetControllerTest.php
Test core functions of the linkset endpoint.
LinksetControllerTest::testCacheability in core/modules/system/tests/src/Functional/Menu/LinksetControllerTest.php
Test the cacheability of the linkset endpoint.
LinksetControllerTest::testCustomLinkRelation in core/modules/system/tests/src/Functional/Menu/LinksetControllerTest.php
Tests that menu items can use a custom link relation.
LinksetControllerTest::testUserAccountMenu in core/modules/system/tests/src/Functional/Menu/LinksetControllerTest.php
Tests that the user account menu behaves as it should.

File

core/modules/system/tests/src/Functional/Menu/LinksetControllerTestBase.php, line 144

Class

LinksetControllerTestBase
A base class for implementing LinksetController tests.

Namespace

Drupal\Tests\system\Functional\Menu

Code

protected function enableEndpoint(bool $enabled) {
    $this->config('system.feature_flags')
        ->set('linkset_endpoint', $enabled)
        ->save(TRUE);
    // Using rebuildIfNeeded here to implicitly test that router is only rebuilt
    // when necessary.
    \Drupal::service('router.builder')->rebuildIfNeeded();
}

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