You are here

public function BlockClassUpdateDisplayTestCase::testUpdateDisplayClass in Block Class 7

Same name and namespace in other branches
  1. 7.2 block_class.test \BlockClassUpdateDisplayTestCase::testUpdateDisplayClass()

Update and display a Block multiple times to ensure CSS class is found.

A Block is updated and displayed several times and with logged in or anonymous user, with Block cache turned enabled or disabled.

File

./block_class.test, line 128
Test the Block Class module.

Class

BlockClassUpdateDisplayTestCase
Test the update and display of the CSS class for a Block.

Code

public function testUpdateDisplayClass() {

  // Edit the block, change the class and check if the CSS classes are found.
  $this
    ->assertUpdateBlockClass();

  // Now, turn on caching programmatically and set it to 15 min expiry.
  variable_set('block_cache', TRUE);
  variable_set('cache_lifetime', 900);
  variable_set('page_cache_maximum_age', 900);

  // Edit the block, change the class and check with the anonymous user.
  $this
    ->assertUpdateBlockClass(TRUE);

  // Edit the block, change the class and check with the anonymous user.
  $this
    ->assertUpdateBlockClass(TRUE);
}