function MenuAccessTest::drupalGet
Same name and namespace in other branches
- 11.x core/modules/system/tests/src/Functional/Menu/MenuAccessTest.php \Drupal\Tests\system\Functional\Menu\MenuAccessTest::drupalGet()
Retrieves a Drupal path or an absolute path.
Parameters
string|\Drupal\Core\Url $path: Drupal path or URL to load into Mink controlled browser.
array $options: (optional) Options to be forwarded to the URL generator.
string[] $headers: An array containing additional HTTP request headers, the array keys are the header names and the array values the header values. This is useful to set for example the "Accept-Language" header for requesting the page in a different language. Note that not all headers are supported, for example the "Accept" header is always overridden by the browser. For testing REST APIs it is recommended to obtain a separate HTTP client using getHttpClient() and performing requests that way.
Return value
string The retrieved HTML string, also available as $this->getRawContent()
Overrides UiHelperTrait::drupalGet
3 calls to MenuAccessTest::drupalGet()
- MenuAccessTest::assertMenuItemRoutesAccess in core/
modules/ system/ tests/ src/ Functional/ Menu/ MenuAccessTest.php - Asserts route requests connected to menu items have the expected access.
- MenuAccessTest::assertUserRoutesAccess in core/
modules/ system/ tests/ src/ Functional/ Menu/ MenuAccessTest.php - Asserts which routes a user has access to.
- MenuAccessTest::testMenuBlockLinksAccessCheck in core/
modules/ system/ tests/ src/ Functional/ Menu/ MenuAccessTest.php - Tests menu link for route with access check.
File
-
core/
modules/ system/ tests/ src/ Functional/ Menu/ MenuAccessTest.php, line 370
Class
- MenuAccessTest
- Tests the route access checks on menu links.
Namespace
Drupal\Tests\system\Functional\MenuCode
protected function drupalGet($path, array $options = [], array $headers = []) {
$return = parent::drupalGet($path, $options, $headers);
$this->assertSession()
->pageTextNotContains('You do not have any administrative items.');
return $return;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.