Skip to content
Snippets Groups Projects
Verified Commit 0948fc87 authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3439898 by simonbaese, quietone, smustgrave, alexpott, marcoscano,...

Issue #3439898 by simonbaese, quietone, smustgrave, alexpott, marcoscano, seanb: Fix Media tests that rely on UID1's super user behavior
parent 05b42068
No related branches found
No related tags found
4 merge requests!5423Draft: Resolve #3329907 "Test2",!3478Issue #3337882: Deleted menus are not removed from content type config,!2964Issue #2865710 : Dependencies from only one instance of a widget are used in display modes,!579Issue #2230909: Simple decimals fail to pass validation
Pipeline #440788 passed with warnings
Pipeline: drupal

#440790

    ......@@ -11,14 +11,6 @@
    */
    class MediaRequirementsTest extends MediaFunctionalTestBase {
    /**
    * {@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}
    */
    ......@@ -38,7 +30,10 @@ public function testMissingSourceFieldDefinition(): void {
    $field_storage_definition->delete();
    $valid_media_type = $this->createMediaType('test');
    $this->drupalLogin($this->rootUser);
    $permissions = [
    'administer site configuration',
    ];
    $this->drupalLogin($this->drupalCreateUser($permissions));
    $this->drupalGet('/admin/reports/status');
    $this->assertSession()->statusCodeEquals(200);
    $this->assertSession()->pageTextContains("The source field definition for the {$media_type->label()} media type is missing.");
    ......
    ......@@ -39,14 +39,6 @@ class ContentModerationTest extends WebDriverTestBase {
    'views',
    ];
    /**
    * {@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}
    */
    ......@@ -189,11 +181,6 @@ protected function setUp(): void {
    * Tests the media library widget only shows published media.
    */
    public function testAdministrationPage(): void {
    // User 1 should be able to see all media items.
    $this->drupalLogin($this->rootUser);
    $this->drupalGet('admin/content/media');
    $this->assertAllMedia();
    // The media admin user should be able to see all media items.
    $this->drupalLogin($this->userAdmin);
    $this->drupalGet('admin/content/media');
    ......@@ -225,11 +212,6 @@ public function testAdministrationPage(): void {
    $media->save();
    }
    // User 1 should still be able to see all media items.
    $this->drupalLogin($this->rootUser);
    $this->drupalGet('admin/content/media');
    $this->assertAllMedia();
    // The media admin user should still be able to see all media items.
    $this->drupalLogin($this->userAdmin);
    $this->drupalGet('admin/content/media');
    ......@@ -262,11 +244,6 @@ public function testWidget(): void {
    $assert_session = $this->assertSession();
    // All users should only be able to see published media items.
    $this->drupalLogin($this->rootUser);
    $this->drupalGet('node/add/article');
    $assert_session->elementExists('css', '.js-media-library-open-button[name^="field_media"]')->click();
    $assert_session->assertWaitOnAjaxRequest();
    $this->assertOnlyPublishedMedia();
    $this->drupalLogin($this->userAdmin);
    $this->drupalGet('node/add/article');
    $assert_session->elementExists('css', '.js-media-library-open-button[name^="field_media"]')->click();
    ......@@ -295,11 +272,6 @@ public function testWidget(): void {
    $media->save();
    }
    $this->drupalLogin($this->rootUser);
    $this->drupalGet('node/add/article');
    $assert_session->elementExists('css', '.js-media-library-open-button[name^="field_media"]')->click();
    $assert_session->assertWaitOnAjaxRequest();
    $this->assertOnlyPublishedMedia();
    $this->drupalLogin($this->userAdmin);
    $this->drupalGet('node/add/article');
    $assert_session->elementExists('css', '.js-media-library-open-button[name^="field_media"]')->click();
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment