- Issue created by @Grevil
This is a follow-up issue to π [regression] Language switcher block throws exception when no route is matched Fixed , where the tests got added.
The issue-fork added a couple of tests which need to get refactored.
From that issue (note that the comment is aimed at "core/modules/language/tests/src/Functional/LanguageSwitchingTest.php"):
Note, that at the start of "testRestrictedPaths()" we are still logged in as the created "admin_user", the test only succeeds, because this user is not a "real" admin user, since he only has the following permissions:
'administer blocks',
'administer languages',
'access administration pages',
'access content',
This makes the test quite hard to understand, since later in this test we log in as a "privileged user" even if the admin should be already privileged with the required permissions.
Furthermore, I do not understand the assertion in line 560:
// Visit a restricted user page.
// Assert that the language switching block is displayed on the
// access-denied page, but it does not contain the path alias.
$this->assertLinkMarkup('/user/1', 403, $block->label(), 'peter-parker');
Why would a block be displayed on a 403 page? Am I missing something here?
Fix the mentioned issues
Active
10.1 β¨