You are here

protected function SlickFormatterTest::setUp in Slick Carousel 8.2

Same name and namespace in other branches
  1. 8 tests/src/Kernel/SlickFormatterTest.php \Drupal\Tests\slick\Kernel\SlickFormatterTest::setUp()

File

tests/src/Kernel/SlickFormatterTest.php, line 43

Class

SlickFormatterTest
Tests the Slick field rendering using the image field type.

Namespace

Drupal\Tests\slick\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installConfig(static::$modules);
  $this
    ->installEntitySchema('slick');
  $this->testFieldName = 'field_image_multiple';
  $this->testEmptyName = 'field_image_multiple_empty';
  $this->testPluginId = 'slick_image';
  $this->maxItems = 7;
  $this->maxParagraphs = 2;
  $this->slickAdmin = $this->container
    ->get('slick.admin');
  $this->slickManager = $this->container
    ->get('slick.manager');
  $this->slickFormatter = $this->container
    ->get('slick.formatter');
  $data['fields'] = [
    'field_video' => 'text',
    'field_image' => 'image',
    'field_image_multiple_empty' => 'image',
  ];

  // Create contents.
  $bundle = $this->bundle;
  $this
    ->setUpContentTypeTest($bundle, $data);
  $settings = [
    'optionset' => 'test',
    'optionset_thumbnail' => 'test_nav',
  ] + $this
    ->getFormatterSettings() + SlickDefault::extendedSettings();
  $data['settings'] = $settings;
  $this->display = $this
    ->setUpFormatterDisplay($bundle, $data);
  $data['plugin_id'] = $this->testPluginId;
  $this->displayEmpty = $this
    ->setUpFormatterDisplay($bundle, $data);
  $this->formatterInstance = $this
    ->getFormatterInstance();
  $this->skins = $this->slickManager
    ->skinManager()
    ->getSkins();
  $this
    ->setUpContentWithItems($bundle);
  $this
    ->setUpRealImage();
}