You are here

protected function MenuTrailByPathTestCase::moveDrupalBlock in Menu Trail By Path 7.3

Same name and namespace in other branches
  1. 7.2 menu_trail_by_path.test \MenuTrailByPathTestCase::moveDrupalBlock()

Move a block to a given region

Parameters

$block_name:

$region:

1 call to MenuTrailByPathTestCase::moveDrupalBlock()
MenuTrailByPathTestCase::setUp in ./menu_trail_by_path.test
Sets up a Drupal site for running functional and integration tests.

File

./menu_trail_by_path.test, line 310
Tests for menu_trail_by_path module.

Class

MenuTrailByPathTestCase
@file Tests for menu_trail_by_path module.

Code

protected function moveDrupalBlock($block_name, $region) {

  // Login
  $this
    ->drupalLogin($this->adminUser);

  // Place the block
  $edit = array();
  $edit['blocks[' . $block_name . '][region]'] = $region;
  $this
    ->drupalPost('admin/structure/block', $edit, t('Save blocks'));
  $this
    ->assertText(t('The block settings have been updated.'), t('Block successfully moved to @region region.', array(
    '@region' => $region,
  )));

  // Confirm that the block is being displayed.
  $this
    ->drupalGet('node');
  $this
    ->assertRaw('id="block-' . str_replace('_', '-', $block_name) . '"', t('Block successfully being displayed on the page.'));

  // Logout
  $this
    ->drupalLogout();
}