You are here

protected function GridStackManagerTest::setUp in GridStack 8.2

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

File

tests/src/Kernel/GridStackManagerTest.php, line 51

Class

GridStackManagerTest
Tests the GridStack manager methods.

Namespace

Drupal\Tests\gridstack\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installConfig([
    'field',
    'node',
    'views',
    'blazy',
    'gridstack',
  ]);
  $bundle = $this->bundle;
  $this->fileSystem = $this->container
    ->get('file_system');
  $this->messenger = $this->container
    ->get('messenger');
  $this->gridstackAdmin = $this->container
    ->get('gridstack.admin');
  $this->blazyAdminFormatter = $this->gridstackAdmin;
  $this->gridstackFormatter = $this->container
    ->get('gridstack.formatter');
  $this->gridstackManager = $this->container
    ->get('gridstack.manager');
  $this->gridstackForm = GridStackForm::create($this->container);
  $this->testPluginId = 'gridstack_image';
  $this->testFieldName = 'field_gridstack_image';
  $this->maxItems = 7;
  $this->maxParagraphs = 2;
  $settings['fields']['field_text_multiple'] = 'text';
  $this
    ->setUpContentTypeTest($bundle, $settings);
  $this
    ->setUpContentWithItems($bundle);
  $this
    ->setUpRealImage();
  $this->display = $this
    ->setUpFormatterDisplay($bundle);
  $this->formatterInstance = $this
    ->getFormatterInstance();

  // Enable Boostrap support.
  $this->gridstackManager
    ->getConfigFactory()
    ->getEditable('gridstack.settings')
    ->set('framework', 'bootstrap')
    ->save();
}