EntityEmbedFilterDisabledIntegrationsTest.php in Entity Embed 8
File
tests/src/Kernel/EntityEmbedFilterDisabledIntegrationsTest.php
View source
<?php
namespace Drupal\Tests\entity_embed\Kernel;
class EntityEmbedFilterDisabledIntegrationsTest extends EntityEmbedFilterTestBase {
protected static $modules = [
'contextual',
'quickedit',
];
protected function setUp() {
parent::setUp();
$this
->installConfig('system');
$this->container
->get('current_user')
->addRole($this
->drupalCreateRole([
'access contextual links',
'access in-place editing',
]));
}
public function testDisabledIntegrations($integration_detection_selector) {
$text = $this
->createEmbedCode([
'data-entity-type' => 'node',
'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID,
'data-view-mode' => 'teaser',
]);
$this
->applyFilter($text);
$this
->assertCount(0, $this
->cssSelect($integration_detection_selector));
}
public function providerDisabledIntegrations() {
return [
'contextual' => [
'div.embedded-entity > .contextual-region',
],
'quickedit' => [
'div.embedded-entity > [data-quickedit-entity-id]',
],
];
}
}