protected function ParagraphsLangcodeChangeTest::buildNodeForm

Builds the node form.

Parameters

bool $embedded: (Optional) Whether the embedded form should be used or not.

1 call to ParagraphsLangcodeChangeTest::buildNodeForm()
ParagraphsLangcodeChangeTest::doTestChangeWithinNodeForm in paragraphs/tests/src/Kernel/ParagraphsLangcodeChangeTest.php
Performs the test run regards the node form.

File

paragraphs/tests/src/Kernel/ParagraphsLangcodeChangeTest.php, line 349

Class

ParagraphsLangcodeChangeTest
Tests the langcode change mechanics of paragraphs.

Namespace

Drupal\Tests\paragraphs\Kernel

Code

protected function buildNodeForm($embedded = FALSE) {
  if ($embedded) {
    $this->formObject = new TestEmbeddedEntityForm($this->node);
  }
  else {
    $this->formObject = $this->entityTypeManager
      ->getFormObject('node', 'default');
    $this->formObject
      ->setEntity($this->node);
  }
  $this->formState = (new FormState())
    ->disableRedirect()
    ->setFormObject($this->formObject);
  $this->form = $this->formBuilder
    ->buildForm($this->formObject, $this->formState);
  $this
    ->reassignEntities();
}