Verified Commit 0894355a authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3439909 by SolimanHarkas, vensires: Fix Taxonomy tests that rely on...

Issue #3439909 by SolimanHarkas, vensires: Fix Taxonomy tests that rely on UID1's super user behavior
parent 8ddf9986
Loading
Loading
Loading
Loading
Loading
+1 −14
Original line number Diff line number Diff line
@@ -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']);