You are here

protected function ContentLanguageAccessTestBase::createContents in Content Language Access 8

Creates a content for each language for the tests.

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

File

src/Tests/ContentLanguageAccessTestBase.php, line 113

Class

ContentLanguageAccessTestBase
Test the features of content_language_access module.

Namespace

Drupal\content_language_access\Tests

Code

protected function createContents() {
  $this
    ->drupalLogin($this->adminUser);
  $languages = $this
    ->getLanguageList();
  foreach ($languages as $language_key => $language) {
    $settings = [
      'title' => 'Test ' . $language
        ->getName(),
      'langcode' => $language_key,
      'type' => $this->contentType
        ->id(),
    ];
    $this->nodes[$language_key] = $this
      ->drupalCreateNode($settings);
  }
}