You are here

public function Pathautoi18nTaxonomyTest::testCustomAliasTaxonomy in Pathauto i18n 7

Test taxonomy terms with custom alias for certain language.

File

tests/pathauto_i18n_taxonomy.test, line 61

Class

Pathautoi18nTaxonomyTest
Test functionality for taxonomy.

Code

public function testCustomAliasTaxonomy() {
  $custom_alias = 'custom/' . $this->title;
  $neutral_alias = 'neutral/' . $this->title;
  $this
    ->createTaxonomyTerm(TRUE, TRUE, $custom_alias);

  // Check aliases and custom alias.
  $this
    ->drupalGet('admin/config/search/path');
  foreach ($this->availableLanguages as $language) {
    $alias = $language . '/' . $this->title;
    $this
      ->assertText($alias, 0, "Exist alias '{$alias}' for language '{$language}'.");
  }
  $this
    ->assertText($custom_alias, 0, "Exist custom alias '{$custom_alias}'.");
  $this
    ->assertNoText($neutral_alias, 0, "Alias '{$neutral_alias}' for undefined language not exist.");
}