You are here

class SkinrUISkinableTestCase in Skinr 8.2

Same name and namespace in other branches
  1. 7.2 tests/skinr_ui.test \SkinrUISkinableTestCase

Tests whether or not elements are skinable in Skinr UI.

Hierarchy

Expanded class hierarchy of SkinrUISkinableTestCase

File

skinr_ui/src/Tests/skinr_ui.test, line 269
Tests for the Skinr UI module.

View source
class SkinrUISkinableTestCase extends DrupalWebTestCase {
  public static function getInfo() {
    return array(
      'name' => 'UI - Is Skinable',
      'description' => 'Tests whether or not elements are skinable in Skinr UI.',
      'group' => 'Skinr',
    );
  }
  function setUp() {
    parent::setUp(array(
      'skinr_ui_test_skinable',
    ));
    $this->admin_user = $this
      ->drupalCreateUser(array(
      'administer blocks',
      'access contextual links',
      'administer skinr',
      'edit skin settings',
      'edit advanced skin settings',
    ));
    $this
      ->drupalLogin($this->admin_user);
  }

  /**
   * Tests if hooks are properly identified as skinable.
   */
  function testHookSkinable() {

    // This test doesn't include the * (all) theme hook option.
    // Only page nodes are allowed.
    $this
      ->drupalGet('skinr-ui-test/element-skinable/node/page');
    $this
      ->assertText('true', t('Element node__page is skinable.'));
    $this
      ->drupalGet('skinr-ui-test/element-skinable/node/article');
    $this
      ->assertText('false', t('Element node__article is not skinable.'));

    // All blocks are allowed.
    $this
      ->drupalGet('skinr-ui-test/element-skinable/block/system__navigation');
    $this
      ->assertText('true', t('Element block__system__navigation is skinable.'));

    // Only page comments are allowed.
    $this
      ->drupalGet('skinr-ui-test/element-skinable/comment/page');
    $this
      ->assertText('true', t('Element comment__page is skinable.'));
    $this
      ->drupalGet('skinr-ui-test/element-skinable/comment/panel');
    $this
      ->assertText('false', t('Element comment__panel is not skinable.'));

    // No regions are allowed.
    $this
      ->drupalGet('skinr-ui-test/element-skinable/system/region__sidebar_first');
    $this
      ->assertText('false', t('Element region__sidebar_first is not skinable.'));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SkinrUISkinableTestCase::getInfo public static function
SkinrUISkinableTestCase::setUp function
SkinrUISkinableTestCase::testHookSkinable function Tests if hooks are properly identified as skinable.