function ContentTranslationLanguageChangeTest::testLanguageSwitchLinks
Tests language switch links while translating content.
File
-
core/
modules/ content_translation/ tests/ src/ Functional/ ContentTranslationLanguageChangeTest.php, line 165
Class
- ContentTranslationLanguageChangeTest
- Tests the content translation language that is set.
Namespace
Drupal\Tests\content_translation\FunctionalCode
public function testLanguageSwitchLinks() : void {
$this->drupalPlaceBlock('language_block:' . LanguageInterface::TYPE_INTERFACE, [
'id' => 'test_language_block',
]);
$this->drupalGet('node/add/article');
$edit = [
'title[0][value]' => 'english_title',
];
$this->submitForm($edit, 'Save');
// Create a translation in French.
$this->clickLink('Translate');
$language_switch_links = $this->xpath('//div[@id=:id]/ul/li', [
':id' => 'block-test-language-block',
]);
$this->assertCount(3, $language_switch_links);
$this->clickLink('Add');
$language_switch_links = $this->xpath('//div[@id=:id]/ul/li', [
':id' => 'block-test-language-block',
]);
$this->assertCount(3, $language_switch_links);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.