You are here

protected function MaxlengthCustomWidgetTest::setUp in Maxlength 8

Overrides BrowserTestBase::setUp

File

tests/src/FunctionalJavascript/MaxlengthCustomWidgetTest.php, line 34

Class

MaxlengthCustomWidgetTest
Tests the custom widget support.

Namespace

Drupal\Tests\maxlength\FunctionalJavascript

Code

protected function setUp() {
  parent::setUp();
  $this
    ->drupalCreateContentType([
    'type' => 'article',
    'name' => 'Article',
  ]);
  EntityFormDisplay::load('node.article.default')
    ->setComponent('body', [
    'type' => 'text_textarea_custom_widget',
    'third_party_settings' => [
      'maxlength' => [
        'maxlength_js' => 200,
      ],
    ],
  ])
    ->save();
}