diff --git a/core/modules/user/tests/src/Unit/TempStoreTest.php b/core/modules/user/tests/src/Unit/TempStoreTest.php
index 68b4e70..f70e9f8 100644
--- a/core/modules/user/tests/src/Unit/TempStoreTest.php
+++ b/core/modules/user/tests/src/Unit/TempStoreTest.php
@@ -58,6 +58,14 @@ class TempStoreTest extends UnitTestCase {
    */
   protected $otherObject;
 
+  public static function getInfo() {
+    return array(
+      'name' => 'TempStore',
+      'description' => 'Tests the temporary object storage system.',
+      'group' => 'TempStore',
+    );
+  }
+
   /**
    * {@inheritdoc}
    */
@@ -342,5 +350,49 @@ public function testDeleteIfOwner() {
     $this->assertFalse($this->tempStore->deleteIfOwner('test_3'));
   }
 
+  /**
+   * Tests lock on the set method.
+   *
+   * @expectedException \Drupal\user\TempStoreException
+   */
+  public function testLockedSet() {
+    $storage = new NullStorageExpirable('tempstore');
+    $lock = $this->getMock('Drupal\Core\Lock\LockBackendInterface');
+
+    // Explicit ensure that the acquire method fails all the time.
+    $lock->expects($this->at(0))
+      ->method('acquire')
+      ->will($this->returnValue(FALSE));
+
+    $lock->expects($this->at(1))
+      ->method('acquire')
+      ->will($this->returnValue(FALSE));
+
+    $tempstore = new TempStore($storage, $lock, 1);
+    $tempstore->set('key', 'value');
+  }
+
+  /**
+   * Tests lock on the delete method.
+   *
+   * @expectedException \Drupal\user\TempStoreException
+   */
+  public function testLockedDelete() {
+    $storage = new NullStorageExpirable('tempstore');
+    $lock = $this->getMock('Drupal\Core\Lock\LockBackendInterface');
+
+    // Explicit ensure that the acquire method fails all the time.
+    $lock->expects($this->at(0))
+      ->method('acquire')
+      ->will($this->returnValue(FALSE));
+
+    $lock->expects($this->at(1))
+      ->method('acquire')
+      ->will($this->returnValue(FALSE));
+
+    $tempstore = new TempStore($storage, $lock, 1);
+    $tempstore->delete('key');
+  }
+
 }
 
