public function BlockListsRoutesAccessTest::testBlockListAccess in Block permissions 8
Test the access to the "/admin/structure/block" page.
@covers ::blockListAccess
File
- tests/
src/ Functional/ BlockListsRoutesAccessTest.php, line 51
Class
- BlockListsRoutesAccessTest
- Tests Block permissions access control handler for block list pages.
Namespace
Drupal\Tests\block_permissions\FunctionalCode
public function testBlockListAccess() {
$block_admin_display_path = Url::fromRoute('block.admin_display');
// Ensure the user has the access to the list of blocks of the default
// theme.
$this
->drupalLogin($this->defaultThemeUser);
$this
->drupalGet($block_admin_display_path);
$this
->assertBlockListPageHasAccess();
// Ensure the user doesn't have the access to the list of blocks of the
// default theme.
$this
->drupalLogin($this->secondThemeUser);
$this
->drupalGet($block_admin_display_path);
$this
->assertSession()
->statusCodeEquals(403);
}