diff --git a/core/modules/toolbar/src/Tests/ToolbarCacheContextsTest.php b/core/modules/toolbar/src/Tests/ToolbarCacheContextsTest.php index 84fdf58..be47b08 100644 --- a/core/modules/toolbar/src/Tests/ToolbarCacheContextsTest.php +++ b/core/modules/toolbar/src/Tests/ToolbarCacheContextsTest.php @@ -7,6 +7,7 @@ namespace Drupal\toolbar\Tests; +use Drupal\Core\Cache\Cache; use Drupal\simpletest\WebTestBase; use Drupal\system\Tests\Cache\AssertPageCacheContextsAndTagsTrait; @@ -95,11 +96,11 @@ public function testToolbarCacheContextsCaller() { /** * Tests that cache contexts are applied for both users. * - * @param array $cache_contexts + * @param string[] $cache_contexts * Expected cache contexts for both users. */ private function testToolbarCacheContexts(array $cache_contexts) { - // Caches has to be rebuilt since modules might have added some routes. + // Caches have to be rebuilt since modules might have added some routes. drupal_flush_all_caches(); // Default cache contexts that should exist on all test cases. @@ -107,7 +108,7 @@ private function testToolbarCacheContexts(array $cache_contexts) { 'languages:language_interface', 'theme', ]; - $cache_contexts = array_merge($default_cache_contexts, $cache_contexts); + $cache_contexts = Cache::mergeContexts($default_cache_contexts, $cache_contexts); // Assert contexts for user1 which has only default permissions. $this->drupalLogin($this->adminUser);