Skip to content
Snippets Groups Projects
Verified Commit e1643718 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

(cherry picked from commit 0894355a)
parent 8f38f5d8
Branches
Tags
7 merge requests!122353526426-warning-for-missing,!11958Issue #3490507 by alexpott, smustgrave: Fix bogus mocking in...,!11769Issue #3517987: Add option to contextual filters to encode slashes in query parameter.,!11185Issue #3477324 by andypost, alexpott: Fix usage of str_getcsv() and fgetcsv() for PHP 8.4,!9944Issue #3483353: Consider making the createCopy config action optionally fail...,!8325Update file Sort.php,!8095Expose document root on install
Pipeline #164289 passed
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
use Drupal\Tests\taxonomy\Traits\TaxonomyTestTrait; use Drupal\Tests\taxonomy\Traits\TaxonomyTestTrait;
use Drupal\Tests\user\Traits\UserCreationTrait; use Drupal\Tests\user\Traits\UserCreationTrait;
use Drupal\Tests\views\Kernel\ViewsKernelTestBase; use Drupal\Tests\views\Kernel\ViewsKernelTestBase;
use Drupal\user\Entity\User;
use Drupal\views\Tests\ViewTestData; use Drupal\views\Tests\ViewTestData;
use Drupal\views\Views; use Drupal\views\Views;
use Drupal\taxonomy\Entity\Vocabulary; use Drupal\taxonomy\Entity\Vocabulary;
...@@ -35,14 +34,6 @@ class TaxonomyFieldVidTest extends ViewsKernelTestBase { ...@@ -35,14 +34,6 @@ class TaxonomyFieldVidTest extends ViewsKernelTestBase {
'filter', '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. * Views used by this test.
* *
...@@ -83,11 +74,7 @@ protected function setUp($import_test_views = TRUE): void { ...@@ -83,11 +74,7 @@ protected function setUp($import_test_views = TRUE): void {
$vocabulary2 = $this->createVocabulary(['vid' => 'bbb']); $vocabulary2 = $this->createVocabulary(['vid' => 'bbb']);
$term = $this->createTerm($vocabulary2); $term = $this->createTerm($vocabulary2);
$this->terms[$term->id()] = $term; $this->terms[$term->id()] = $term;
$this->adminUser = $this->createUser(['administer taxonomy']);
// 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->container->get('current_user')->setAccount($this->adminUser); $this->container->get('current_user')->setAccount($this->adminUser);
ViewTestData::createTestViews(static::class, ['taxonomy_test_views']); ViewTestData::createTestViews(static::class, ['taxonomy_test_views']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment