diff --git a/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualBlockCacheTest.php b/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualBlockCacheTest.php index dcb8bc1..cabaac5 100644 --- a/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualBlockCacheTest.php +++ b/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualBlockCacheTest.php @@ -39,20 +39,19 @@ function setUp() { * Tests contextual links on Active forum topics block with different users. */ function testForumBlock() { - // Set the forum_active block to the content region. - $edit = array(); - $edit['blocks[forum_active][region]'] = 'content'; - $this->drupalPost('admin/structure/block', $edit, t('Save blocks')); - $this->assertText(t('The block settings have been updated.'), 'Active forum topics block successfully moved to content region.'); + // Enable the Active forum topics block. + $block = $this->drupalPlaceBlock('forum_active_block'); + $this->assertText(t('The block configuration has been saved.'), '"Active forum topics" block was enabled'); + $configure_link = 'admin/structure/block/manage/' . $block['config_id'] . '/' . variable_get('theme_default', 'stark') . '/configure'; // Make sure the block is visible on the front page to the logged in user. $this->drupalGet('node'); - $this->assertLinkByHref('admin/structure/block/manage/forum/active/configure', 0, 'Configure block link for Active forum topics block is displayed.'); + $this->assertLinkByHref($configure_link, 0, 'Configure block link for Active forum topics block is displayed.'); // Log out and make sure the "Configure block" link is not visible to // anonymous users. $this->drupalLogout(); $this->drupalGet('node'); - $this->assertNoLinkByHref('admin/structure/block/manage/forum/active/configure', 'Configure block link for Active forum topics block is not displayed for logged out user.'); + $this->assertNoLinkByHref($configure_link, 0, 'Configure block link for Active forum topics block is not displayed for logged out user.'); } }