protected function ParagraphsTypeHasEnabledBehaviorPluginTest::setUp

File

paragraphs/tests/src/Kernel/ParagraphsTypeHasEnabledBehaviorPluginTest.php, line 38

Class

ParagraphsTypeHasEnabledBehaviorPluginTest
Tests the ParagraphsType entity hasEnabledBehaviorPlugin functionality.

Namespace

Drupal\Tests\paragraphs\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->installEntitySchema('user');
  $this
    ->installEntitySchema('paragraph');
  \Drupal::moduleHandler()
    ->loadInclude('paragraphs', 'install');

  // Create a paragraph with an enabled and disabled plugin.
  $this->paragraphsType = ParagraphsType::create([
    'label' => 'test_text',
    'id' => 'test_text',
    'behavior_plugins' => [
      'test_text_color' => [
        'enabled' => TRUE,
      ],
      'test_dummy_behavior' => [
        'enabled' => FALSE,
      ],
    ],
  ]);
  $this->paragraphsType
    ->save();
}