You are here

public function BlockAttributesMenuBlockTestCase::testMenuBlockDisplayAttributes in Block Attributes 7

Create, update and display a Menu Block to ensure attributes are found.

A Menu Block is added through the user interface. It is then updated and displayed several times with logged in or anonymous user.

File

./block_attributes.test, line 509
Test the Block Attributes module.

Class

BlockAttributesMenuBlockTestCase
Test Block Attributes integration with Menu Block.

Code

public function testMenuBlockDisplayAttributes() {

  // Get Block Attributes testing data.
  $block_attributes = $this
    ->getBlockAttributesTestingData() + array(
    'menu_name' => 'navigation',
    'regions[bartik]' => 'content',
  );

  // Start with the creation of a new Menu Block.
  $this
    ->drupalPost("admin/structure/block/add-menu-block", $block_attributes, t('Save block'));

  // Check if the Block was successfully created.
  $this
    ->assertText(t('The block has been created.'));

  // Browse to the homepage.
  $this
    ->drupalGet('');

  // Assert whether Block's attributes could be found on the page.
  $this
    ->assertBlockAttributesDisplay($block_attributes);

  // Run the standard tests on the existing Menu Block created above.
  // Edit the block, change the class and check with the anonymous user.
  $this
    ->assertUpdateDisplayBlockAttributes(TRUE);
}