diff -u b/core/modules/comment/tests/src/Entity/CommentLockTest.php b/core/modules/comment/tests/src/Entity/CommentLockTest.php --- b/core/modules/comment/tests/src/Entity/CommentLockTest.php +++ b/core/modules/comment/tests/src/Entity/CommentLockTest.php @@ -27,9 +27,9 @@ $container->set('module_handler', $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface')); $container->set('current_user', $this->getMock('Drupal\Core\Session\AccountInterface')); $container->set('cache.test', $this->getMock('Drupal\Core\Cache\CacheBackendInterface')); - $requestStack = new RequestStack(); - $requestStack->push(Request::create('/')); - $container->set('request_stack', $requestStack); + $request_stack = new RequestStack(); + $request_stack->push(Request::create('/')); + $container->set('request_stack', $request_stack); $container->setParameter('cache_bins', array('cache.test' => 'test')); $lock = $this->getMock('Drupal\Core\Lock\LockBackendInterface'); $cid = 2; diff -u b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php --- b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php +++ b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php @@ -16,7 +16,6 @@ use Drupal\Core\Language\Language; use Drupal\Core\Language\LanguageInterface; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; use Drupal\language\LanguageNegotiatorInterface; /** @@ -63,11 +62,6 @@ function setUp() { parent::setUp(); - $this->request = Request::createFromGlobals(); - $requestStack = new RequestStack(); - $requestStack->push($this->request); - $this->container->set('request_stack', $requestStack); - $admin_user = $this->drupalCreateUser(array('administer languages', 'translate interface', 'access administration pages', 'administer blocks')); $this->drupalLogin($admin_user); } @@ -435,7 +429,7 @@ // Base path gives problems on the testbot, so $correct_link is hard-coded. // @see UrlAlterFunctionalTest::assertUrlOutboundAlter (path.test). $italian_url = url('admin', array('language' => $languages['it'], 'script' => '')); - $url_scheme = $this->request->isSecure() ? 'https://' : 'http://'; + $url_scheme = \Drupal::request()->isSecure() ? 'https://' : 'http://'; $correct_link = $url_scheme . $link; $this->assertEqual($italian_url, $correct_link, format_string('The url() function returns the right URL (@url) in accordance with the chosen language', array('@url' => $italian_url))); diff -u b/core/modules/simpletest/src/TestBase.php b/core/modules/simpletest/src/TestBase.php --- b/core/modules/simpletest/src/TestBase.php +++ b/core/modules/simpletest/src/TestBase.php @@ -1089,9 +1089,9 @@ $request = Request::create('/'); - $requestStack = new RequestStack(); - $requestStack->push($request); - $this->container->set('request_stack', $requestStack); + $request_stack = new RequestStack(); + $request_stack->push($request); + $this->container->set('request_stack', $request_stack); // Run all tests as a anonymous user by default, web tests will replace that // during the test set up.