You are here

function sweaverThemeSettings::sweaverSaveStyle in Sweaver 6

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

Save a style.

Parameters

$scenario: The id of the scenario.

$configuration: A collection of configuration options.

$style_id: The id of the style.

$live: Whether the live should exist or not.

$equal_check: Whether to check on both files.

$equal: Whether they have to be equal or not.

$debug: Whether to write debug info or not.

4 calls to sweaverThemeSettings::sweaverSaveStyle()
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 222
Advanced tests for sweaver editor + theme settings.

Class

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

Code

function sweaverSaveStyle($scenario, $configuration, $style_id, $live = FALSE, $check = FALSE, $equal = FALSE, $debug = FALSE) {
  $form_state['values'] = $configuration['edit'];
  $form = $configuration['form'];
  $this
    ->performStyleAction('Save and continue', $form_state, $form);
  $css = $this
    ->getCSS($style_id);

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

  // Assert draft css is written, live not.
  $this
    ->assertCSSFiles($scenario, $style_id, TRUE, $live, $check, $equal);
  if ($debug) {
    $this
      ->sweaver_filesdir_scan();
  }
}