Issue #3439925 by simonbaese, smustgrave, vensires: Fix Core tests that rely on UID1's super user behavior

merge-requests/5753/merge
Alex Pott 2024-04-20 17:05:31 +01:00
parent 8474559cbd
commit cbad32ab34
No known key found for this signature in database
GPG Key ID: BDA67E7EE836E5CE
3 changed files with 11 additions and 18 deletions

View File

@ -26,14 +26,6 @@ class ClaroTest extends BrowserTestBase {
*/
protected static $modules = ['dblog', 'shortcut', 'pager_test'];
/**
* {@inheritdoc}
*
* @todo Remove and fix test to not rely on super user.
* @see https://www.drupal.org/project/drupal/issues/3437620
*/
protected bool $usesSuperUserAccessPolicy = TRUE;
/**
* {@inheritdoc}
*/
@ -55,7 +47,10 @@ class ClaroTest extends BrowserTestBase {
* Tests Claro's configuration schema.
*/
public function testConfigSchema() {
$this->drupalLogin($this->rootUser);
$permissions = [
'administer modules',
];
$this->drupalLogin($this->drupalCreateUser($permissions));
$this->drupalGet('admin/modules');
$this->assertSession()->elementNotExists('css', '#block-claro-help');

View File

@ -27,21 +27,17 @@ class RouteProviderTest extends KernelTestBase {
*/
protected static $modules = ['entity_test', 'user', 'system'];
/**
* {@inheritdoc}
*
* @todo Remove and fix test to not rely on super user.
* @see https://www.drupal.org/project/drupal/issues/3437620
*/
protected bool $usesSuperUserAccessPolicy = TRUE;
/**
* {@inheritdoc}
*/
protected function setUp(): void {
parent::setUp();
$this->setUpCurrentUser(['uid' => 1]);
$permissions = [
'administer entity_test content',
'view test entity',
];
$this->setUpCurrentUser(['uid' => 2], $permissions);
$this->installEntitySchema('entity_test_mul');
$this->installEntitySchema('entity_test_admin_routes');

View File

@ -10,6 +10,8 @@ use Drupal\Tests\user\Traits\UserCreationTrait;
/**
* Tests the caching of render items via functional tests.
*
* @todo Remove or updated in https://www.drupal.org/project/drupal/issues/3436395.
*
* @group Render
*/
class RenderCacheTest extends KernelTestBase {