diff --git a/block_example/block_example.routing.yml b/block_example/block_example.routing.yml index e9fe04b..6468da6 100644 --- a/block_example/block_example.routing.yml +++ b/block_example/block_example.routing.yml @@ -4,4 +4,4 @@ block_example.description: _controller: '\Drupal\block_example\Controller\BlockExampleController::description' _title: 'Block Example' requirements: - _access: 'access content' + _permission: 'access content' diff --git a/block_example/src/Tests/BlockExampleMenuTest.php b/block_example/src/Tests/BlockExampleMenuTest.php index 8dc85cb..5e47b22 100644 --- a/block_example/src/Tests/BlockExampleMenuTest.php +++ b/block_example/src/Tests/BlockExampleMenuTest.php @@ -38,30 +38,16 @@ class BlockExampleMenuTest extends WebTestBase { * Test for a link to the block example in the Tools menu. */ public function testBlockExampleLink() { - // Login with the user having 'access content' permission. - $this->drupalLogin($this->drupalCreateUser(['access content'])); $this->drupalGet(''); $this->assertLinkByHref('examples/block_example'); - - // Logout and become anonymous user. - $this->drupalLogout(); - $this->drupalGet(''); - $this->assertNoLinkByHref('examples/block_example'); } /** * Tests block_example menus. */ public function testBlockExampleMenu() { - // Login with the user having 'access content' permission. - $this->drupalLogin($this->drupalCreateUser(['access content'])); $this->drupalGet('examples/block_example'); $this->assertResponse(200, 'Description page exists.'); - - // Logout and become anonymous user. - $this->drupalLogout(); - $this->drupalGet('examples/block_example'); - $this->assertResponse(401, 'Access denied for description page.'); } }