You are here

function sweaverThemeSettings::sweaverPublishStyle in Sweaver 7

Same name and namespace in other branches
  1. 6 tests/sweaver.themesettings.test \sweaverThemeSettings::sweaverPublishStyle()

Publish a style.

Parameters

$scenario: The id of the scenario.

$configuration: A collection of configuration options.

$style_id: The id of the style.

4 calls to sweaverThemeSettings::sweaverPublishStyle()
sweaverThemeSettings::testScenarioA in tests/sweaver.themesettings.test
Scenario A.
sweaverThemeSettings::testScenarioB in tests/sweaver.themesettings.test
Scenario B.
sweaverThemeSettings::testScenarioC in tests/sweaver.themesettings.test
Scenario C.
sweaverThemeSettings::testScenarioD in tests/sweaver.themesettings.test
Scenario D.

File

tests/sweaver.themesettings.test, line 258
Advanced tests for sweaver editor + theme settings.

Class

sweaverThemeSettings
@file Advanced tests for sweaver editor + theme settings.

Code

function sweaverPublishStyle($scenario, $configuration, $style_id) {
  $form_state['values'] = $configuration['edit'];
  $form_state['values']['publish_id'] = $style_id;
  $this
    ->performStyleAction('Publish style', $form_state, $configuration['form']);
  $css = $this
    ->getCSS($style_id, FALSE);

  // Assert CSS is equal.
  $this
    ->assertEqual($configuration['edit']['sweaver-css'], $css->css, t('CSS is equal for style id ' . $css->style_id . ' in scenario ' . $scenario));

  // Assert draft css is written, live too and css filesize are equal.
  $this
    ->assertCSSFiles($scenario, $style_id, TRUE, TRUE, TRUE, TRUE);
}