function test_cobrand_headers() { $headers = cobrand_headers('nosite', 'common_header'); $this->assertEqual('', $headers, 'Should return an empty string for common_header with no cobrand'); $headers = cobrand_headers('mysite', 'common_header'); $this->assertEqual('My-Header: hello', $headers, 'Should return the value of the cobrand header function if one exists'); }
<?php header("Content-Type: text/html; charset=utf-8"); if (isset($values['cobrand'])) { print cobrand_headers($values['cobrand'], 'common_header'); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>WriteToThem - <? print $values['title']; ?></title> <link href="/wtt.css" rel="stylesheet" type="text/css" media="all"> <link href="/print.css" rel="stylesheet" type="text/css" media="print"> <!--[if LT IE 7]> <style type="text/css">@import url("/ie6.css");</style> <![endif]--> <?php if (array_key_exists('stylesheet', $values)) { ?> <style type="text/css">@import "<?php echo $values['stylesheet']; ?> ";</style> <?php } if (array_key_exists('robots', $values)) { ?> <meta name="robots" content="<?php echo $values['robots']; ?>