You are here

protected function FieldWidgetDisplayTest::setUp in Entity Browser 8.2

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

Overrides KernelTestBase::setUp

File

tests/src/Kernel/Plugin/FieldWidgetDisplayTest.php, line 33

Class

FieldWidgetDisplayTest
Tests field widget display plugins.

Namespace

Drupal\Tests\entity_browser\Kernel\Plugin

Code

protected function setUp() {
  parent::setUp();
  $this->pluginManager = $this->container
    ->get('plugin.manager.entity_browser.field_widget_display');
  $image_style = $this->container
    ->get('entity_type.manager')
    ->getStorage('image_style');
  $image_style
    ->create([
    'name' => 'thumbnail',
    'label' => 'Thumbnail',
  ])
    ->save();
  $image_style
    ->create([
    'name' => 'large',
    'label' => 'Large',
  ])
    ->save();
  $comment_type = $this->container
    ->get('entity_type.manager')
    ->getStorage('comment_type');
  $comment_type
    ->create([
    'id' => 'comment',
    'label' => 'Comment',
  ])
    ->save();
  $view_mode = $this->container
    ->get('entity_type.manager')
    ->getStorage('entity_view_mode');
  $view_mode
    ->create([
    'id' => 'comment.full',
    'targetEntityType' => 'comment',
  ])
    ->save();
}