You are here

protected function BlazyUnitTestTrait::getFormatterSettings in Blazy 8

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

Returns sensible formatter settings for testing purposes.

Return value

array The formatter settings.

9 calls to BlazyUnitTestTrait::getFormatterSettings()
BlazyEntityReferenceFormatterTest::buildContents in tests/src/Kernel/BlazyEntityReferenceFormatterTest.php
Build contents.
BlazyFormatterTest::setUp in tests/src/Kernel/BlazyFormatterTest.php
Set the default field storage backend for fields created during tests.
BlazyFormatterTest::testBlazyFormatterMethods in tests/src/Kernel/BlazyFormatterTest.php
Tests the Blazy formatter methods.
BlazyManagerTest::testBuildAttributes in tests/src/Kernel/BlazyManagerTest.php
Tests building Blazy attributes.
BlazyUnitTestTrait::getDefaultFormatterDefinition in tests/src/Traits/BlazyUnitTestTrait.php
Returns the default field formatter definition.

... See full list

File

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

Class

BlazyUnitTestTrait
A Trait common for Blazy Unit tests.

Namespace

Drupal\Tests\blazy\Traits

Code

protected function getFormatterSettings() {
  $defaults = [
    'box_caption' => 'custom',
    'box_style' => 'large',
    'breakpoints' => $this
      ->getDataBreakpoints(),
    'cache' => 0,
    'image_style' => 'blazy_crop',
    'media_switch' => 'blazy_test',
    'thumbnail_style' => 'thumbnail',
    'ratio' => 'fluid',
    'caption' => [
      'alt' => 'alt',
      'title' => 'title',
    ],
    'sizes' => '100w',
  ] + BlazyDefault::extendedSettings();
  return empty($this->formatterSettings) ? $defaults : array_merge($defaults, $this->formatterSettings);
}