Commit 441357f2 authored by alexpott's avatar alexpott

Issue #2795615 by GoZ: Rename LanguageUILanguageNegotiationTest::runTest to...

Issue #2795615 by GoZ: Rename LanguageUILanguageNegotiationTest::runTest to LanguageUILanguageNegotiationTest::doRunTest
parent 7125a800
......@@ -136,7 +136,7 @@ function testUILanguageNegotiation() {
'http_header' => $http_header_browser_fallback,
'message' => 'SELECTED: UI language is switched based on selected language.',
);
$this->runTest($test);
$this->doRunTest($test);
// An invalid language is selected.
$this->config('language.negotiation')->set('selected_langcode', NULL)->save();
......@@ -148,7 +148,7 @@ function testUILanguageNegotiation() {
'http_header' => $http_header_browser_fallback,
'message' => 'SELECTED > DEFAULT: UI language is switched based on selected language.',
);
$this->runTest($test);
$this->doRunTest($test);
// No selected language is available.
$this->config('language.negotiation')->set('selected_langcode', $langcode_unknown)->save();
......@@ -160,7 +160,7 @@ function testUILanguageNegotiation() {
'http_header' => $http_header_browser_fallback,
'message' => 'SELECTED > DEFAULT: UI language is switched based on selected language.',
);
$this->runTest($test);
$this->doRunTest($test);
$tests = array(
// Default, browser preference should have no influence.
......@@ -211,7 +211,7 @@ function testUILanguageNegotiation() {
);
foreach ($tests as $test) {
$this->runTest($test);
$this->doRunTest($test);
}
// Unknown language prefix should return 404.
......@@ -240,7 +240,7 @@ function testUILanguageNegotiation() {
'http_header' => array(),
'message' => 'USER > DEFAULT: no preferred user language setting, the UI language is default',
);
$this->runTest($test);
$this->doRunTest($test);
// Set preferred langcode for user to unknown language.
$account = $this->loggedInUser;
......@@ -255,7 +255,7 @@ function testUILanguageNegotiation() {
'http_header' => array(),
'message' => 'USER > DEFAULT: invalid preferred user language setting, the UI language is default',
);
$this->runTest($test);
$this->doRunTest($test);
// Set preferred langcode for user to non default.
$account->preferred_langcode = $langcode;
......@@ -269,7 +269,7 @@ function testUILanguageNegotiation() {
'http_header' => array(),
'message' => 'USER > DEFAULT: defined preferred user language setting, the UI language is based on user setting',
);
$this->runTest($test);
$this->doRunTest($test);
// Set preferred admin langcode for user to NULL.
$account->preferred_admin_langcode = NULL;
......@@ -283,7 +283,7 @@ function testUILanguageNegotiation() {
'http_header' => array(),
'message' => 'USER ADMIN > DEFAULT: no preferred user admin language setting, the UI language is default',
);
$this->runTest($test);
$this->doRunTest($test);
// Set preferred admin langcode for user to unknown language.
$account->preferred_admin_langcode = $langcode_unknown;
......@@ -297,7 +297,7 @@ function testUILanguageNegotiation() {
'http_header' => array(),
'message' => 'USER ADMIN > DEFAULT: invalid preferred user admin language setting, the UI language is default',
);
$this->runTest($test);
$this->doRunTest($test);
// Set preferred admin langcode for user to non default.
$account->preferred_admin_langcode = $langcode;
......@@ -311,7 +311,7 @@ function testUILanguageNegotiation() {
'http_header' => array(),
'message' => 'USER ADMIN > DEFAULT: defined preferred user admin language setting, the UI language is based on user setting',
);
$this->runTest($test);
$this->doRunTest($test);
// Go by session preference.
$language_negotiation_session_param = $this->randomMachineName();
......@@ -337,11 +337,11 @@ function testUILanguageNegotiation() {
),
);
foreach ($tests as $test) {
$this->runTest($test);
$this->doRunTest($test);
}
}
protected function runTest($test) {
protected function doRunTest($test) {
$test += array('path_options' => []);
if (!empty($test['language_negotiation'])) {
$method_weights = array_flip($test['language_negotiation']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment