You are here

function SkinrUIBasicTestCase::testSkinEditThemeHooks in Skinr 8.2

Same name and namespace in other branches
  1. 7.2 tests/skinr_ui.test \SkinrUIBasicTestCase::testSkinEditThemeHooks()

Tests access control for editing additional CSS classes.

File

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

Class

SkinrUIBasicTestCase
Tests UI functionality.

Code

function testSkinEditThemeHooks() {

  // Widget should appear for system blocks.
  $this
    ->drupalGet('admin/structure/skinr/edit/block/system__user-menu/configure');
  $this
    ->assertField('edit-skinr-settings-bartik-groups-general-skinr-ui-test-color-color-white', 'The widget, which is limited to system blocks, appeared on the configuration form for system\'s user-menu block.');

  // Widget should not appear search blocks.
  $this
    ->drupalGet('admin/structure/skinr/edit/block/search__form/configure');
  $this
    ->assertNoField('edit-skinr-settings-bartik-groups-general-skinr-ui-test-color-color-white', 'The widget, which is limited to system blocks, did not appear on the configuration form for search\'s form block.');

  // Widget should appear for page node comments.
  $this
    ->drupalGet('admin/structure/skinr/edit/comment/page/configure');
  $this
    ->assertField('edit-skinr-settings-bartik-groups-general-skinr-ui-test-color-color-white', 'The widget, which is limited to page node comments, appeared on the configuration form for page node comments.');

  // Widget should not appear for article node comments.
  $this
    ->drupalGet('admin/structure/skinr/edit/comment/article/configure');
  $this
    ->assertNoField('edit-skinr-settings-bartik-groups-general-skinr-ui-test-color-color-white', 'The widget, which is limited to page node comments, did not appear on the configuration form for article node comments.');

  // Widget should appear for page nodes.
  $this
    ->drupalGet('admin/structure/skinr/edit/node/page/configure');
  $this
    ->assertField('edit-skinr-settings-bartik-groups-general-skinr-ui-test-color-color-white', 'The widget, which is limited to page node types, appeared on the configuration form for page node types.');

  // Widget should not appear for article nodes.
  $this
    ->drupalGet('admin/structure/skinr/edit/node/article/configure');
  $this
    ->assertNoField('edit-skinr-settings-bartik-groups-general-skinr-ui-test-color-color-white', 'The widget, which is limited to page node types, did not appear on the configuration form for article node types.');
}