Verified Commit 941b7e79 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3439871 by SolimanHarkas, vensires: Fix Help tests that rely on UID1's super user behavior

parent 1c914f2d
Loading
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -33,14 +33,6 @@ class HelpTest extends BrowserTestBase {
    'history',
  ];

  /**
   * {@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}
   */
@@ -77,7 +69,10 @@ protected function setUp(): void {
  public function testHelp() {
    // Log in the root user to ensure as many admin links appear as possible on
    // the module overview pages.
    $this->drupalLogin($this->rootUser);
    $this->drupalLogin($this->drupalCreateUser([
      'access help pages',
      'access administration pages',
    ]));
    $this->verifyHelp();

    // Log in the regular user.
+8 −10
Original line number Diff line number Diff line
@@ -29,14 +29,6 @@ class HelpTopicSearchTest extends HelpTopicTranslatedTestBase {
    'language',
  ];

  /**
   * {@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}
   */
@@ -266,7 +258,10 @@ public function testUninstall() {
    \Drupal::service('module_installer')->uninstall(['help_topics_test']);
    // Ensure we can uninstall help_topics and use the help system without
    // breaking.
    $this->drupalLogin($this->rootUser);
    $this->drupalLogin($this->createUser([
      'administer modules',
      'access help pages',
    ]));
    $edit = [];
    $edit['uninstall[help]'] = TRUE;
    $this->drupalGet('admin/modules/uninstall');
@@ -283,7 +278,10 @@ public function testUninstall() {
  public function testUninstallSearch() {
    // Ensure we can uninstall search and use the help system without
    // breaking.
    $this->drupalLogin($this->rootUser);
    $this->drupalLogin($this->createUser([
      'administer modules',
      'access help pages',
    ]));
    $edit = [];
    $edit['uninstall[search]'] = TRUE;
    $this->drupalGet('admin/modules/uninstall');
+4 −9
Original line number Diff line number Diff line
@@ -29,14 +29,6 @@ class HelpTopicsSyntaxTest extends BrowserTestBase {
    'locale',
  ];

  /**
   * {@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}
   */
@@ -46,7 +38,10 @@ class HelpTopicsSyntaxTest extends BrowserTestBase {
   * Tests that all Core help topics can be rendered and have good syntax.
   */
  public function testHelpTopics() {
    $this->drupalLogin($this->rootUser);
    $this->drupalLogin($this->createUser([
      'administer modules',
      'access help pages',
    ]));

    // Enable all modules and themes, so that all routes mentioned in topics
    // will be defined.