diff --git a/core/tests/Drupal/Tests/Core/Cache/Context/SessionCacheContextTest.php b/core/tests/Drupal/Tests/Core/Cache/Context/SessionCacheContextTest.php
index 9538bd2..25c194a 100644
--- a/core/tests/Drupal/Tests/Core/Cache/Context/SessionCacheContextTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/Context/SessionCacheContextTest.php
@@ -14,6 +14,13 @@
 class SessionCacheContextTest extends UnitTestCase {
 
   /**
+   * The request.
+   *
+   * @var \Symfony\Component\HttpFoundation\Request
+   */
+  protected $request;
+
+  /**
    * The request stack.
    *
    * @var \Symfony\Component\HttpFoundation\RequestStack
@@ -35,21 +42,22 @@ class SessionCacheContextTest extends UnitTestCase {
   protected $cacheContext;
 
   public function setUp() {
-    $request = new Request();
+    $this->request = new Request();
 
     $this->requestStack = new RequestStack();
-    $this->requestStack->push($request);
-
-    $this->session = $this->getMock('\Symfony\Component\HttpFoundation\Session\SessionInterface');
-    $request->setSession($this->session);
+    $this->requestStack->push($this->request);
 
-    $this->cacheContext = new SessionCacheContext($this->requestStack);
+    $this->session = $this->getMockBuilder('\Symfony\Component\HttpFoundation\Session\SessionInterface')
+      ->getMock();
   }
 
   /**
    * @covers ::getContext
    */
   public function testSameContextForSameSession() {
+    $this->request->setSession($this->session);
+    $this->cacheContext = new SessionCacheContext($this->requestStack);
+
     $session_id = 'aSebeZ52bbM6SvADurQP89SFnEpxY6j8';
     $this->session->expects($this->exactly(2))
       ->method('getId')
@@ -65,6 +73,9 @@ public function testSameContextForSameSession() {
    * @covers ::getContext
    */
   public function testDifferentContextForDifferentSession() {
+    $this->request->setSession($this->session);
+    $this->cacheContext = new SessionCacheContext($this->requestStack);
+
     $session1_id = 'pjH_8aSoofyCDQiuVYXJcbfyr-CPtkUY';
     $this->session->expects($this->at(0))
       ->method('getId')
@@ -83,4 +94,15 @@ public function testDifferentContextForDifferentSession() {
     $this->assertSame(FALSE, strpos($context2, $session2_id), 'Session ID not contained in cache context');
   }
 
+  /**
+   * @covers ::getContext
+   * @runInSeparateProcess
+   */
+  public function testContextWithoutSessionInRequest() {
+    $this->cacheContext = new SessionCacheContext($this->requestStack);
+
+    $context = $this->cacheContext->getContext();
+    $this->assertSame('none', $context);
+  }
+
 }
