diff --git a/core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php b/core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php
index e7fd9cd..89e1d94 100644
--- a/core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php
+++ b/core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php
@@ -141,9 +141,6 @@ protected function assertCacheTags(array $expected_tags, $include_default_tags =
    *   (optional) A verbose message to output.
    * @param bool $include_default_contexts
    *   (optional) Whether the default contexts should automatically be included.
-   *
-   * @return
-   *   TRUE if the assertion succeeded, FALSE otherwise.
    */
   protected function assertCacheContexts(array $expected_contexts, $message = NULL, $include_default_contexts = TRUE) {
     if ($include_default_contexts) {
@@ -159,12 +156,14 @@ protected function assertCacheContexts(array $expected_contexts, $message = NULL
     $actual_contexts = $this->getCacheHeaderValues('X-Drupal-Cache-Contexts');
     sort($expected_contexts);
     sort($actual_contexts);
-    $return = $this->assertIdentical($actual_contexts, $expected_contexts, $message);
-    if (!$return) {
+
+    $match = $actual_contexts === $expected_contexts;
+    if (!$match) {
       debug('Unwanted cache contexts in response: ' . implode(',', array_diff($actual_contexts, $expected_contexts)));
       debug('Missing cache contexts in response: ' . implode(',', array_diff($expected_contexts, $actual_contexts)));
     }
-    return $return;
+
+    $this->assert($match, $message);
   }
 
   /**
diff --git a/core/modules/toolbar/src/Tests/ToolbarCacheContextsTest.php b/core/modules/toolbar/src/Tests/ToolbarCacheContextsTest.php
index 6995d59..586d0df 100644
--- a/core/modules/toolbar/src/Tests/ToolbarCacheContextsTest.php
+++ b/core/modules/toolbar/src/Tests/ToolbarCacheContextsTest.php
@@ -96,9 +96,6 @@ public function testToolbarCacheContextsCaller() {
    *   Expected cache contexts for both users.
    * @param string $message
    *   (optional) A verbose message to output.
-   *
-   * @return
-   *   TRUE if the assertion succeeded, FALSE otherwise.
    */
   protected function assertToolbarCacheContexts(array $cache_contexts, $message = NULL) {
     // Default cache contexts that should exist on all test cases.
@@ -112,21 +109,25 @@ protected function assertToolbarCacheContexts(array $cache_contexts, $message =
     // Assert contexts for user1 which has only default permissions.
     $this->drupalLogin($this->adminUser);
     $this->drupalGet('test-page');
-    $return = $this->assertCacheContexts($cache_contexts);
+    if ($message) {
+       $message_default = $message . ' (Default permissions)';
+    }
+    else {
+      $message_default = 'Expected cache contexts found for user with only default permissions.';
+    }
+    $this->assertCacheContexts($cache_contexts, $message_default);
     $this->drupalLogout();
 
     // Assert contexts for user2 which has some additional permissions.
     $this->drupalLogin($this->adminUser2);
     $this->drupalGet('test-page');
-    $return = $return && $this->assertCacheContexts($cache_contexts);
-
-    if ($return) {
-      $this->pass($message);
+    if ($message) {
+      $message_additional = $message . ' (Additional permissions)';
     }
     else {
-      $this->fail($message);
+      $message_additional = $message ? $message : 'Expected cache contexts found for user with some additional permissions.';
     }
-    return $return;
+    $this->assertCacheContexts($cache_contexts, $message_additional);
   }
 
   /**
