public function SearchByPageIntlTest::testTranslations in Search by Page 8
Tests that environment settings for main module and paths are translated.
File
- tests/
src/ Functional/ search_by_page.test, line 2689 - Tests for the Search by Page module. By Jennifer Hodgdon of Poplar ProductivityWare, www.poplarware.com
Class
- SearchByPageIntlTest
- Environment internationalization test.
Namespace
Drupal\Tests\search_by_page\FunctionalCode
public function testTranslations() {
$this
->translateEnvironment();
// Visit the search results page in English, and verify that all the
// test strings are there.
$this
->drupalPostForm($this->envinfo1['page_path'], array(
'keys' => 'Trees',
), t('Search button 1 label'));
$this
->doLanguageTest('en');
// Now visit the page in the other language and test.
$languageManager = new \Drupal\Core\Language\LanguageManager();
$langs = $languageManager
->getLanguages();
$lang = $langs[$this->lang_to_use];
$this
->drupalPostForm($this->envinfo1['page_path'], array(
'keys' => 'Trees',
), $this->strings_to_test['button_label'], array(
'language' => $lang,
));
$this
->doLanguageTest($this->lang_to_use);
}