You are here

function sweaverThemeSettings::assertThemeSettings in Sweaver 7

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

Asserts for theme settings.

Parameters

$scenario: The id of the scenario.

$style_id: The id of the style.

$site_name: Whether the $site_name is visible or not.

$logo: The extension of the logo.

$favicon: The name of the favicon.

$original: Whether we need to look for the original logo/favicon.

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

Class

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

Code

function assertThemeSettings($scenario, $style_id, $site_name, $original = TRUE, $logo = '', $favicon = '') {
  $this
    ->drupalGet('node');

  // Test on site name.
  if ($site_name) {
    $this
      ->assertNoRaw('<div id="site-name" class="element-invisible">', t('Site name is visible for style id ' . $style_id . ' in scenario ' . $scenario));
  }
  else {
    $this
      ->assertRaw('<div id="site-name" class="element-invisible">', t('Site name is not visible for style id ' . $style_id . ' in scenario ' . $scenario));
  }
  if ($original) {
    $this
      ->assertRaw('/themes/bartik/logo.png', t('Logo is original bartik for style id ' . $style_id . ' in scenario ' . $scenario));
    $this
      ->assertRaw('/misc/favicon.ico', t('Favicon is original druplicon for style id ' . $style_id . ' in scenario ' . $scenario));
  }
  else {
    $this
      ->assertNoRaw('/themes/bartik/logo.png', t('Logo is not original bartik for style id ' . $style_id . ' in scenario ' . $scenario));
    $this
      ->assertNoRaw('/misc/favicon.ico', t('Favicon is not original druplicon for style id ' . $style_id . ' in scenario ' . $scenario));
    $live_logo = '/sweaver/logo_bartik_' . $style_id . '_live.' . $logo;
    $live_favicon = '/sweaver/favicon_bartik_' . $style_id . '_live.' . $favicon;
    $this
      ->assertRaw($live_logo, t('Logo is uploaded logo for style id ' . $style_id . ' in scenario ' . $scenario . ' (' . $live_logo . ')'));
    $this
      ->assertRaw($live_favicon, t('Favicon is uploaded logo for style id ' . $style_id . ' in scenario ' . $scenario . ' (' . $live_favicon . ')'));
  }
}