function EditorImageDialogTest::setUp
Sets up the test.
Overrides EntityKernelTestBase::setUp
File
- 
              core/modules/ editor/ tests/ src/ Kernel/ EditorImageDialogTest.php, line 46 
Class
- EditorImageDialogTest
- Tests EditorImageDialog validation and conversion functionality.
Namespace
Drupal\Tests\editor\KernelCode
protected function setUp() : void {
  parent::setUp();
  $this->installEntitySchema('file');
  $this->installSchema('node', [
    'node_access',
  ]);
  $this->installSchema('file', [
    'file_usage',
  ]);
  $this->installConfig([
    'node',
  ]);
  // Add text formats.
  $format = FilterFormat::create([
    'format' => 'filtered_html',
    'name' => 'Filtered HTML',
    'weight' => 0,
    'filters' => [
      'filter_align' => [
        'status' => TRUE,
      ],
      'filter_caption' => [
        'status' => TRUE,
      ],
    ],
  ]);
  $format->save();
  // Set up text editor.
  $editor = Editor::create([
    'format' => 'filtered_html',
    'editor' => 'unicorn',
    'image_upload' => [
      'max_size' => 100,
      'scheme' => 'public',
      'directory' => '',
      'max_dimensions' => [
        'width' => NULL,
        'height' => NULL,
      ],
      'status' => TRUE,
    ],
  ]);
  $editor->save();
  $this->editor = $editor;
  // Create a node type for testing.
  $type = NodeType::create([
    'type' => 'page',
    'name' => 'page',
  ]);
  $type->save();
  node_add_body_field($type);
  $this->installEntitySchema('user');
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
