You are here

clean_markup_blocks.test in Clean Markup 7.2

Tests for the Clean Block Markup module.

File

modules/clean_markup_blocks/clean_markup_blocks.test
View source
<?php

/**
 * @file
 * Tests for the Clean Block Markup module.
 */

/**
 * Tests the Clean Block Markup functionality.
 */
class CleanMarkupBlocksTestCase extends DrupalWebTestCase {

  /**
   * {@inheritdoc}
   */
  public static function getInfo() {
    return array(
      'name' => 'Clean Block Markup test',
      'description' => 'Tests the clean block markup functionality.',
      'group' => 'Clean Markup',
    );
  }

  /**
   * {@inheritdoc}
   */
  public function setUp() {
    parent::setUp('block', 'clean_markup', 'clean_markup_blocks');
  }

  /**
   * Test that the defaults are correct.
   */
  public function testDefaults() {
    $expected_defaults = array(
      'block_wrapper' => 'div',
      'additional_block_classes' => '',
      'additional_block_attributes' => '',
      'enable_inner_div' => FALSE,
      'title_wrapper' => 'h2',
      'title_hide' => FALSE,
      'content_wrapper' => CLEAN_MARKUP_NO_ELEMENT,
      'block_html_id_as_class' => TRUE,
    );
    $current_defaults = variable_get('clean_markup_blocks-defaults', NULL);
    $this
      ->assertEqual($current_defaults, $expected_defaults, 'Current defaults match expected defaults.');
  }

  /**
   * Test _clean_markup_blocks_generate_prefix().
   */
  public function testGeneratePrefix() {
    $expected_prefix = 'clean_markup_blocks--foo-bar-baz';
    $generated_prefix = _clean_markup_blocks_generate_prefix('foo', 'bar-baz');
    $this
      ->assertEqual($expected_prefix, $generated_prefix, 'Prefixes generated properly.');
  }

}

Classes

Namesort descending Description
CleanMarkupBlocksTestCase Tests the Clean Block Markup functionality.