Exemplo n.º 1
0
 public function testGetSetAfterBodyScript()
 {
     $view = new View();
     $this->assertEquals('', $view->getAfterBodyScripts());
     $view->appendAfterBodyScript('file.js');
     $view->appendAfterBodyScript('script', false);
     $expected = "<script src=\"file.js\" type=\"text/javascript\"></script>\n";
     $expected .= "<script type=\"text/javascript\">script</script>";
     $this->assertEquals($expected, $view->getAfterBodyScripts());
     $view->prependAfterBodyScript('file2.js');
     $view->prependAfterBodyScript('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->getAfterBodyScripts());
 }