You are here

protected function StyleguidePaletteTest::testMultipleThemes in Style Guide 7

Tests adding swatches to multiple themes.

File

styleguide_palette/styleguide_palette.test, line 198
Tests for styleguide_palette.module.

Class

StyleguidePaletteTest
Tests style guide palette functionality.

Code

protected function testMultipleThemes() {
  theme_enable(array(
    'stark',
  ));
  $edit = array(
    'name' => $this
      ->randomName(),
    'hex' => '#123456',
  );
  $this
    ->drupalPost('admin/config/user-interface/styleguide-palette/edit/stark', $edit, t('Save palette'));
  $this
    ->assertFieldByXPath('//input[@name="palette[' . $edit['name'] . '][hex]"]', $edit['hex'], 'The newly added color swatch is shown.');
  $this
    ->drupalGet('admin/config/user-interface/styleguide-palette/edit');
  $this
    ->assertNoFieldByXPath('//input[@name="palette[' . $edit['name'] . '][hex]"]', $edit['hex'], 'The color swatch is only shown for its theme.');
}