You are here

protected function NodeTranslation::setUp in Metatag 8

Overrides BrowserTestBase::setUp

File

tests/src/Functional/NodeTranslation.php, line 45

Class

NodeTranslation
Verify that node translation form works.

Namespace

Drupal\Tests\metatag\Functional

Code

protected function setUp() {
  parent::setUp();

  // Login.
  $this
    ->loginUser1();

  // Add language.
  $this
    ->drupalGet('/admin/config/regional/language/add');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $edit = [
    'predefined_langcode' => 'hu',
  ];
  $this
    ->drupalPostForm(NULL, $edit, 'Add language');

  // Set up a content type.
  $this
    ->drupalCreateContentType([
    'type' => 'article',
  ]);
  $this
    ->drupalGet('/admin/structure/types/manage/article');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $edit = [
    'language_configuration[content_translation]' => TRUE,
  ];
  $this
    ->drupalPostForm(NULL, $edit, 'Save content type');
}