MediaEmbedFilterDisabledIntegrationsTest.php

Same filename in this branch
  1. 9 core/modules/media/tests/src/Kernel/MediaEmbedFilterDisabledIntegrationsTest.php
Same filename in other branches
  1. 8.9.x core/modules/media/tests/src/Kernel/MediaEmbedFilterDisabledIntegrationsTest.php
  2. 10 core/modules/media/tests/src/Kernel/MediaEmbedFilterDisabledIntegrationsTest.php
  3. 11.x core/modules/media/tests/src/Kernel/MediaEmbedFilterDisabledIntegrationsTest.php

Namespace

Drupal\Tests\quickedit\Kernel

File

core/modules/quickedit/tests/src/Kernel/MediaEmbedFilterDisabledIntegrationsTest.php

View source
<?php

namespace Drupal\Tests\quickedit\Kernel;

use Drupal\Tests\media\Kernel\MediaEmbedFilterTestBase;

/**
 * Tests that media embed disables certain integrations.
 *
 * @coversDefaultClass \Drupal\media\Plugin\Filter\MediaEmbed
 * @group quickedit
 * @group legacy
 */
class MediaEmbedFilterDisabledIntegrationsTest extends MediaEmbedFilterTestBase {
    
    /**
     * {@inheritdoc}
     */
    protected static $modules = [
        'contextual',
        'quickedit',
        // @see media_test_embed_entity_view_alter()
'media_test_embed',
    ];
    
    /**
     * {@inheritdoc}
     */
    protected function setUp() : void {
        parent::setUp();
        $this->container
            ->get('current_user')
            ->addRole($this->drupalCreateRole([
            'access contextual links',
            'access in-place editing',
        ]));
    }
    
    /**
     * @covers ::renderMedia
     * @covers ::disableContextualLinks
     */
    public function testDisabledIntegrations() {
        $text = $this->createEmbedCode([
            'data-entity-type' => 'media',
            'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID,
        ]);
        $this->applyFilter($text);
        $this->assertCount(1, $this->cssSelect('div[data-media-embed-test-view-mode]'));
        $this->assertCount(0, $this->cssSelect('div[data-media-embed-test-view-mode][data-quickedit-entity-id]'));
    }

}

Classes

Title Deprecated Summary
MediaEmbedFilterDisabledIntegrationsTest Tests that media embed disables certain integrations.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.