You are here

public function SiteBannerRenderingUnitTestCase::testBannerColorsRendered in Site Banner 7

Tests whether correct colors are rendered in the CSS tags.

File

./site_banner.test, line 167

Class

SiteBannerRenderingUnitTestCase
Implements tests for checking that banner rendering functions are correct.

Code

public function testBannerColorsRendered() {
  $background_color = variable_get('site_banner_background_color', '');
  $text_color = variable_get('site_banner_text_color', '');
  $page = array();
  site_banner_page_build($page);
  $css_string = "#siteBannerFooterBanner, #siteBannerHeaderBanner {background-color:{$background_color}; color:{$text_color};}";
  $result = FALSE;
  foreach (drupal_add_css() as $css_tags) {
    $result |= $css_string === $css_tags['data'];
  }
  $message = 'Banner colors appear in HEAD tag in correct format. Current CSS string: ' . $css_string;
  $this
    ->assertTrue($result, $message);
}