You are here

public function Pathautoi18nTestBase::prepareTest in Pathauto i18n 8

Prepare test.

3 calls to Pathautoi18nTestBase::prepareTest()
Pathautoi18nNodeTest::setUp in src/Tests/Pathautoi18nNodeTest.php
SetUp method.
Pathautoi18nTaxonomyTest::setUp in src/Tests/Pathautoi18nTaxonomyTest.php
SetUp method.
Pathautoi18nUserTest::setUp in src/Tests/Pathautoi18nUserTest.php
SetUp method.

File

src/Tests/Pathautoi18nTestBase.php, line 47
Tests for the pathauto_i18n node module.

Class

Pathautoi18nTestBase
Test functionality for nodes when language selected.

Namespace

Drupal\pathauto_i18n\Tests

Code

public function prepareTest() {
  $this->admin = $this
    ->drupalCreateUser([
    'administer modules',
    'administer site configuration',
    'administer languages',
    'access administration pages',
    'create url aliases',
    'administer pathauto',
    'administer url aliases',
  ]);
  $this
    ->drupalLogin($this->admin);
  foreach ($this->availableLanguages as $language) {
    if ($language != $this->contentLanguage) {
      $this
        ->drupalPostForm('admin/config/regional/language/add', [
        'predefined_langcode' => $language,
      ], t('Add language'));
    }
  }

  // @todo Enable multilingual support for content type.
  // $this->drupalPost('admin/structure/types/manage/article', array('language_content_type' => 1), t('Save content type'));
}