diff --git a/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyFieldVidTest.php b/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyFieldVidTest.php index 3225190a74d2a537cf0b63ca50ddaf15e8c844c9..33d80f99a46c3c43dd3759d033690ae7b1ba3607 100644 --- a/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyFieldVidTest.php +++ b/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyFieldVidTest.php @@ -8,7 +8,6 @@ use Drupal\Tests\taxonomy\Traits\TaxonomyTestTrait; use Drupal\Tests\user\Traits\UserCreationTrait; use Drupal\Tests\views\Kernel\ViewsKernelTestBase; -use Drupal\user\Entity\User; use Drupal\views\Tests\ViewTestData; use Drupal\views\Views; use Drupal\taxonomy\Entity\Vocabulary; @@ -35,14 +34,6 @@ class TaxonomyFieldVidTest extends ViewsKernelTestBase { 'filter', ]; - /** - * {@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; - /** * Views used by this test. * @@ -83,11 +74,7 @@ protected function setUp($import_test_views = TRUE): void { $vocabulary2 = $this->createVocabulary(['vid' => 'bbb']); $term = $this->createTerm($vocabulary2); $this->terms[$term->id()] = $term; - - // Create user 1 and set is as the logged in user, so that the logged in - // user has the correct permissions to view the vocabulary name. - $this->adminUser = User::create(['name' => $this->randomString()]); - $this->adminUser->save(); + $this->adminUser = $this->createUser(['administer taxonomy']); $this->container->get('current_user')->setAccount($this->adminUser); ViewTestData::createTestViews(static::class, ['taxonomy_test_views']);