You are here

protected function BlazyUnitTestTrait::getDefaultFormatterDefinition in Blazy 8

Same name and namespace in other branches
  1. 8.2 tests/src/Traits/BlazyUnitTestTrait.php \Drupal\Tests\blazy\Traits\BlazyUnitTestTrait::getDefaultFormatterDefinition()

Returns the default field formatter definition.

Return value

array The default field formatter settings.

3 calls to BlazyUnitTestTrait::getDefaultFormatterDefinition()
BlazyAdminExtendedUnitTest::testBuildSettingsForm in tests/src/Unit/Form/BlazyAdminExtendedUnitTest.php
Tests BlazyAdminExtended.
BlazyAdminFormatterUnitTest::testBuildSettingsForm in tests/src/Unit/Form/BlazyAdminFormatterUnitTest.php
@covers ::buildSettingsForm @covers ::openingForm @covers ::imageStyleForm @covers ::mediaSwitchForm @covers ::gridForm @covers ::breakpointsForm @covers ::closingForm @covers ::finalizeForm
BlazyUnitTestTrait::getFormatterDefinition in tests/src/Traits/BlazyUnitTestTrait.php
Returns the field formatter definition along with settings.

File

tests/src/Traits/BlazyUnitTestTrait.php, line 123

Class

BlazyUnitTestTrait
A Trait common for Blazy Unit tests.

Namespace

Drupal\Tests\blazy\Traits

Code

protected function getDefaultFormatterDefinition() {

  // @deprecated: Will be replaced by `form` array below.
  $deprecated = [
    'grid_form' => TRUE,
    'image_style_form' => TRUE,
    'fieldable_form' => TRUE,
    'media_switch_form' => TRUE,
  ];
  return [
    'background' => TRUE,
    'box_captions' => TRUE,
    'breakpoints' => BlazyDefault::getConstantBreakpoints(),
    'captions' => [
      'alt' => 'Alt',
      'title' => 'Title',
    ],
    'classes' => [
      'field_class' => 'Classes',
    ],
    'current_view_mode' => 'default',
    'entity_type' => $this->entityType,
    'field_name' => $this->testFieldName,
    'field_type' => 'image',
    'multimedia' => TRUE,
    'images' => [
      $this->testFieldName => $this->testFieldName,
    ],
    'layouts' => [
      'top' => 'Top',
    ],
    'links' => [
      'field_link' => 'Link',
    ],
    'namespace' => 'blazy',
    'responsive_image' => TRUE,
    'thumbnail_style' => TRUE,
    'skins' => [
      'classic' => 'Classic',
    ],
    'style' => 'grid',
    'target_type' => 'file',
    'titles' => [
      'field_text' => 'Text',
    ],
    'view_mode' => 'default',
    'settings' => $this
      ->getFormatterSettings(),
    'form' => [
      'fieldable',
      'grid',
      'image_style',
      'media_switch',
    ],
  ] + $deprecated;
}