You are here

protected function ContentLanguageAccessTestBase::createContentType in Content Language Access 8

Creates a random content type for test execution.

1 call to ContentLanguageAccessTestBase::createContentType()
ContentLanguageAccessTestBase::setUp in src/Tests/ContentLanguageAccessTestBase.php
Implements setUp().

File

src/Tests/ContentLanguageAccessTestBase.php, line 98

Class

ContentLanguageAccessTestBase
Test the features of content_language_access module.

Namespace

Drupal\content_language_access\Tests

Code

protected function createContentType(array $values = []) {
  $this->contentType = $this
    ->drupalCreateContentType();

  // Set the content type to use multilingual support.
  $this
    ->drupalGet("admin/structure/types/manage/{$this->contentType->id()}");
  $this
    ->assertText(t('Language settings'), 'Multilingual support widget present on content type configuration form.');
  $edit = [
    'language_configuration[language_alterable]' => TRUE,
  ];
  $this
    ->drupalPostForm("admin/structure/types/manage/{$this->contentType->id()}", $edit, t('Save content type'));
  $this
    ->assertRaw(t('The content type %type has been updated.', [
    '%type' => $this->contentType
      ->label(),
  ]));
}