You are here

function sweaverThemeSettings::assertThemeSettings in Sweaver 6

Same name and namespace in other branches
  1. 7 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 421
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
      ->assertRaw('<span>Drupal</span>', t('Site name is visible for style id ' . $style_id . ' in scenario ' . $scenario));
  }
  else {
    $this
      ->assertNoRaw('<span>Drupal</span>', t('Site name is not visible for style id ' . $style_id . ' in scenario ' . $scenario));
  }
  if ($original) {
    $this
      ->assertRaw('/themes/garland/logo.png', t('Logo is original garland 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/garland/logo.png', t('Logo is not original garland 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 = file_directory_path() . '/sweaver/logo_garland_' . $style_id . '_live.' . $logo;
    $live_favicon = file_directory_path() . '/sweaver/favicon_garland_' . $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 . ')'));
  }
}