core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php b/core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php index d0c0685..f20cb62 100644 --- a/core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php +++ b/core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php @@ -222,7 +222,7 @@ function testCacheClearByCacheTag() { // Assert that a cache tag in the toolbar cache under the key "user" exists // for admin_user against the language "en". $cache = $toolbarCache->get('toolbar_' . $admin_user_id . ':' . 'en'); - $this->assertEqual($cache->tags[2], 'user:' . $admin_user_id, 'A cache tag in the toolbar cache under the key "user" exists for admin_user against the language "en".'); + $this->assertEqual(in_array('user:' . $admin_user_id, $cache->tags), 'A cache tag in the toolbar cache under the key "user" exists for admin_user against the language "en".'); // Assert that no toolbar cache exists for admin_user against the // language "fr". @@ -242,7 +242,7 @@ function testCacheClearByCacheTag() { // Assert that a cache tag in the toolbar cache under the key "user" exists // for admin_user against the language "fr". $cache = $toolbarCache->get('toolbar_' . $admin_user_id . ':' . 'fr'); - $this->assertEqual($cache->tags[2], 'user:' . $admin_user_id, 'A cache tag in the toolbar cache under the key "user" exists for admin_user against the language "fr".'); + $this->assertEqual(in_array('user:' . $admin_user_id, $cache->tags), 'A cache tag in the toolbar cache under the key "user" exists for admin_user against the language "fr".'); // Log in the admin_user_2 user. We will use this user as a control to // verify that clearing a cache tag for admin_user does not clear the cache @@ -255,7 +255,7 @@ function testCacheClearByCacheTag() { // Assert that a cache tag in the toolbar cache under the key "user" exists // for admin_user_2 against the language "en". $cache = $toolbarCache->get('toolbar_' . $admin_user_2_id . ':' . 'en'); - $this->assertEqual($cache->tags[2], 'user:' . $admin_user_2_id, 'A cache tag in the toolbar cache under the key "user" exists for admin_user_2 against the language "en".'); + $this->assertEqual(in_array('user:' . $admin_user_2_id, $cache->tags), 'A cache tag in the toolbar cache under the key "user" exists for admin_user_2 against the language "en".'); // Request a page in 'fr' to create the cache. $this->drupalGet('fr/test-page'); @@ -263,7 +263,7 @@ function testCacheClearByCacheTag() { // Assert that a cache tag in the toolbar cache under the key "user" exists // for admin_user against the language "fr". $cache = $toolbarCache->get('toolbar_' . $admin_user_2_id . ':' . 'fr'); - $this->assertEqual($cache->tags[2], 'user:' . $admin_user_2_id, 'A cache tag in the toolbar cache under the key "user" exists for admin_user_2 against the language "fr".'); + $this->assertEqual(in_array('user:' . $admin_user_2_id, $cache->tags), 'A cache tag in the toolbar cache under the key "user" exists for admin_user_2 against the language "fr".'); // Log in admin_user and clear the caches for this user using a tag. $this->drupalLogin($this->admin_user); @@ -285,12 +285,12 @@ function testCacheClearByCacheTag() { // Assert that a cache tag in the toolbar cache under the key "user" exists // for admin_user_2 against the language "en". $cache = $toolbarCache->get('toolbar_' . $admin_user_2_id . ':' . 'en'); - $this->assertEqual($cache->tags[2], 'user:' . $admin_user_2_id, 'A cache tag in the toolbar cache under the key "user" exists for admin_user_2 against the language "en".'); + $this->assertEqual(in_array('user:' . $admin_user_2_id, $cache->tags), 'A cache tag in the toolbar cache under the key "user" exists for admin_user_2 against the language "en".'); // Assert that a cache tag in the toolbar cache under the key "user" exists // for admin_user_2 against the language "fr". $cache = $toolbarCache->get('toolbar_' . $admin_user_2_id . ':' . 'fr'); - $this->assertEqual($cache->tags[2], 'user:' . $admin_user_2_id, 'A cache tag in the toolbar cache under the key "user" exists for admin_user_2 against the language "fr".'); + $this->assertEqual(in_array('user:' . $admin_user_2_id, $cache->tags), 'A cache tag in the toolbar cache under the key "user" exists for admin_user_2 against the language "fr".'); } /** @@ -374,7 +374,7 @@ function testLocaleTranslationSubtreesHashCacheClear() { // Assert that a cache tag in the toolbar cache under the key "user" exists // for admin_user against the language "xx". $cache = $toolbarCache->get('toolbar_' . $admin_user_id . ':' . $langcode); - $this->assertEqual($cache->tags[2], 'user:' . $admin_user_id, 'A cache tag in the toolbar cache under the key "user" exists for admin_user against the language "xx".'); + $this->assertEqual(in_array('user:' . $admin_user_id, $cache->tags), 'A cache tag in the toolbar cache under the key "user" exists for admin_user against the language "xx".'); // Get a baseline hash for the admin menu subtrees before translating one // of the menu link items.