You are here

public function PreviewLinkEntityTest::testDefaultSettings in Preview Link 2.x

Same name and namespace in other branches
  1. 2.0.x tests/src/Kernel/PreviewLinkEntityTest.php \Drupal\Tests\preview_link\Kernel\PreviewLinkEntityTest::testDefaultSettings()

Test default settings.

@covers ::entitiesDefaultFieldSettings

File

tests/src/Kernel/PreviewLinkEntityTest.php, line 72

Class

PreviewLinkEntityTest
Preview link session test.

Namespace

Drupal\Tests\preview_link\Kernel

Code

public function testDefaultSettings() : void {
  $definition = \Drupal::entityTypeManager()
    ->getDefinition('preview_link');
  $baseFields = PreviewLink::baseFieldDefinitions($definition);
  $settings = $baseFields['entities']
    ->getSettings();
  $this
    ->assertTrue($settings['exclude_entity_types']);
  $this
    ->assertEquals([], $settings['entity_type_ids']);
  $this
    ->assertEquals([
    'handler' => 'preview_link',
    'handler_settings' => [],
  ], $settings['entity_test_mulrevpub']);
}