You are here

protected function GridStackFileFormatterTest::setUp in GridStack 8

File

tests/src/Kernel/GridStackFileFormatterTest.php, line 41

Class

GridStackFileFormatterTest
Tests the GridStack field rendering using the text field type.

Namespace

Drupal\Tests\gridstack\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installConfig(static::$modules);
  $this
    ->installEntitySchema('gridstack');
  $this->testFieldName = 'field_file_multiple';
  $this->testEmptyName = 'field_file_multiple_empty';
  $this->testFieldType = 'image';
  $this->testPluginId = 'gridstack_file';
  $this->maxItems = 7;
  $this->maxParagraphs = 2;
  $this->gridstackAdmin = $this->container
    ->get('gridstack.admin');
  $this->gridstackManager = $this->container
    ->get('gridstack.manager');
  $this->gridstackFormatter = $this->container
    ->get('gridstack.formatter');

  // Create contents.
  $bundle = $this->bundle;
  $data = [
    'field_name' => $this->testEmptyName,
    'field_type' => 'image',
  ];
  $this
    ->setUpContentTypeTest($bundle, $data);
  $this
    ->setUpContentWithItems($bundle);
  $this->display = $this
    ->setUpFormatterDisplay($bundle);
  $data['plugin_id'] = $this->testPluginId;
  $this->displayEmpty = $this
    ->setUpFormatterDisplay($bundle, $data);
  $this->formatterInstance = $this
    ->getFormatterInstance();
}