Add a basic test for the header generation.

Este commit está contenido en:
Sébastien Lucas 2014-02-14 17:10:14 +01:00
padre cc4f5e892f
commit 7f9cf87cb6
Se han modificado 1 ficheros con 22 adiciones y 0 borrados

Ver fichero

@ -25,6 +25,28 @@ class BaseTest extends PHPUnit_Framework_TestCase
$this->assertNull (serverSideRender (NULL));
}
/* The function for the head of the HTML catalog */
public function testGenerateHeader ()
{
$_SERVER["HTTP_USER_AGENT"] = "Firefox";
global $config;
$headcontent = file_get_contents(dirname(__FILE__) . '/../templates/' . getCurrentTemplate () . '/file.html');
$template = new doT ();
$dot = $template->template ($headcontent, NULL);
$data = array("title" => $config['cops_title_default'],
"version" => VERSION,
"opds_url" => $config['cops_full_url'] . "feed.php",
"template" => getCurrentTemplate (),
"server_side_rendering" => useServerSideRendering (),
"current_css" => getCurrentCss (),
"favico" => $config['cops_icon'],
"getjson_url" => "getJSON.php?" . addURLParameter (getQueryString (), "complete", 1));
$head = $dot ($data);
$this->assertContains ("<head>", $head);
$this->assertContains ("</head>", $head);
}
public function testLocalize ()
{
$this->assertEquals ("Authors", localize ("authors.title"));