diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php index a658cfb..aea41ef 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php @@ -23,7 +23,7 @@ class CommentTokenReplaceTest extends CommentTestBase { * Creates a comment, then tests the tokens generated from it. */ function testCommentTokenReplacement() { - global $language_interface; + $language_interface = drupal_container()->get(LANGUAGE_TYPE_INTERFACE); $url_options = array( 'absolute' => TRUE, 'language' => $language_interface, diff --git a/core/modules/poll/lib/Drupal/poll/Tests/PollTokenReplaceTest.php b/core/modules/poll/lib/Drupal/poll/Tests/PollTokenReplaceTest.php index 1e19ec0..3aaab13 100644 --- a/core/modules/poll/lib/Drupal/poll/Tests/PollTokenReplaceTest.php +++ b/core/modules/poll/lib/Drupal/poll/Tests/PollTokenReplaceTest.php @@ -23,7 +23,7 @@ class PollTokenReplaceTest extends PollTestBase { * Creates a poll, then tests the tokens generated from it. */ function testPollTokenReplacement() { - global $language_interface; + $language_interface = drupal_container()->get(LANGUAGE_TYPE_INTERFACE); // Craete a poll with three choices. $title = $this->randomName(); diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php index 12c6f11..902fe6a 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php @@ -608,7 +608,8 @@ abstract class TestBase { * @see TestBase::tearDown() */ protected function prepareEnvironment() { - global $user, $language_interface, $conf; + global $user, $conf; + $language_interface = drupal_container()->get(LANGUAGE_TYPE_INTERFACE); // Backup current in-memory configuration. $this->originalConf = $conf; @@ -672,7 +673,8 @@ abstract class TestBase { * @see TestBase::prepareEnvironment() */ protected function tearDown() { - global $user, $language_interface, $conf; + global $user, $conf; + $language_interface = drupal_container()->get(LANGUAGE_TYPE_INTERFACE); // In case a fatal error occurred that was not in the test process read the // log to pick up any fatal errors. diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php index 3045611..0cc6e41 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php @@ -23,7 +23,7 @@ class StatisticsTokenReplaceTest extends StatisticsTestBase { * Creates a node, then tests the statistics tokens generated from it. */ function testStatisticsTokenReplacement() { - global $language_interface; + $language_interface = drupal_container()->get(LANGUAGE_TYPE_INTERFACE); // Create user and node. $user = $this->drupalCreateUser(array('create page content')); diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php index 9c3d7aa..441a2ba 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php @@ -218,7 +218,7 @@ class CascadingStylesheetsTest extends WebTestBase { */ function testAlter() { // Switch the language to a right to left language and add system.base.css. - global $language_interface; + $language_interface = drupal_container()->get(LANGUAGE_TYPE_INTERFACE); $language_interface->direction = LANGUAGE_RTL; $path = drupal_get_path('module', 'system'); drupal_add_css($path . '/system.base.css'); diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/MailTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/MailTest.php index cf33f48..831fcea 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/MailTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/MailTest.php @@ -41,7 +41,7 @@ class MailTest extends WebTestBase implements MailInterface { * Assert that the pluggable mail system is functional. */ public function testPluggableFramework() { - global $language_interface; + $language_interface = drupal_container()->get(LANGUAGE_TYPE_INTERFACE); // Use MailTestCase for sending a message. $message = drupal_mail('simpletest', 'mail_test', 'testing@example.com', $language_interface); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserTokenReplaceTest.php b/core/modules/user/lib/Drupal/user/Tests/UserTokenReplaceTest.php index d6466cd..5cd3cd3 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserTokenReplaceTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserTokenReplaceTest.php @@ -25,7 +25,7 @@ class UserTokenReplaceTest extends WebTestBase { * Creates a user, then tests the tokens generated from it. */ function testUserTokenReplacement() { - global $language_interface; + $language_interface = drupal_container()->get(LANGUAGE_TYPE_INTERFACE); $url_options = array( 'absolute' => TRUE, 'language' => $language_interface,