public function Pathautoi18nNodeTest::testCustomAliasLanguageSelected in Pathauto i18n 7
Test nodes with custom alias for certain language.
File
- tests/
pathauto_i18n_node.test, line 59
Class
- Pathautoi18nNodeTest
- Test functionality for nodes.
Code
public function testCustomAliasLanguageSelected() {
$custom_alias = 'custom/' . $this->title;
$this
->createNode($this->contentLanguage, TRUE, FALSE, $custom_alias);
// Check aliases and custom alias.
$this
->drupalGet('admin/config/search/path');
foreach ($this->availableLanguages as $language) {
if ($language == 'en') {
$alias = $language . '/' . $this->title;
$this
->assertText($custom_alias, 0, "Exist custom alias '{$custom_alias}'.");
$this
->assertNoText($alias, 0, "Alias '{$alias}' for language '{$language}' not exist.");
}
else {
$alias = $language . '/' . $this->title;
$this
->assertText($alias, 0, "Exist alias '{$alias}' for language '{$language}'.");
}
}
}