You are here

public function EntityEmbedTestBase::assertAvailableDisplayPlugins in Entity Embed 8

Assert that the expected display plugins are available for the entity.

3 calls to EntityEmbedTestBase::assertAvailableDisplayPlugins()
EntityReferenceFieldFormatterTest::testEntityReferenceFieldFormatter in tests/src/Functional/EntityReferenceFieldFormatterTest.php
Tests entity reference field formatters.
FileFieldFormatterTest::testFileFieldFormatter in tests/src/Functional/FileFieldFormatterTest.php
Tests file field formatter Entity Embed Display plugins.
ImageFieldFormatterTest::testImageFieldFormatter in tests/src/Functional/ImageFieldFormatterTest.php
Tests image field formatter Entity Embed Display plugin.

File

tests/src/Functional/EntityEmbedTestBase.php, line 135

Class

EntityEmbedTestBase
Base class for all entity_embed tests.

Namespace

Drupal\Tests\entity_embed\Functional

Code

public function assertAvailableDisplayPlugins(EntityInterface $entity, array $expected_plugins, $message = '') {
  $plugin_options = $this->container
    ->get('plugin.manager.entity_embed.display')
    ->getDefinitionOptionsForEntity($entity);
  $this
    ->assertEquals([], array_diff($expected_plugins, array_keys($plugin_options)), $message);
}