Ejemplo n.º 1
0
 public function testGetSetHeadScript()
 {
     $view = new View();
     $this->assertEquals('', $view->getHeadScripts());
     $view->appendHeadScript('file.js');
     $view->appendHeadScript('script', false);
     $expected = "<script src=\"file.js\" type=\"text/javascript\"></script>\n";
     $expected .= "<script type=\"text/javascript\">script</script>";
     $this->assertEquals($expected, $view->getHeadScripts());
     $view->prependHeadScript('file2.js');
     $view->prependHeadScript('script2', false);
     $expected2 = "<script type=\"text/javascript\">script2</script>\n";
     $expected2 .= "<script src=\"file2.js\" type=\"text/javascript\"></script>\n";
     $expected2 .= $expected;
     $this->assertEquals($expected2, $view->getHeadScripts());
 }