You are here

public function Pathautoi18nNodeTest::testCustomAliasUndefinedLanguage in Pathauto i18n 7

Test nodes with custom alias for undefined language.

File

tests/pathauto_i18n_node.test, line 90

Class

Pathautoi18nNodeTest
Test functionality for nodes.

Code

public function testCustomAliasUndefinedLanguage() {
  $custom_alias = 'custom/' . $this->title;
  $neutral_alias = 'neutral/' . $this->title;
  $this
    ->createNode(LANGUAGE_NONE, TRUE, FALSE, $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.");
}