/** * @loadFixture * @test */ public function defaultJs() { $headBlock = new Mage_Page_Block_Html_Head(); $headBlock->addJs('prototype/prototype.js'); $headBlock->addJs('mage/translate.js'); $html = $headBlock->getCssJsHtml(); $this->assertContains('prototype/prototype.js', $html); $this->assertContains('mage/translate.js', $html); }
public function testGetCssJsHtml() { $this->_block->addJs('zero.js', '', null, 'nonexisting_condition')->addJs('varien/js.js')->addJs('Mage_Bundle::bundle.js')->addCss('tiny_mce/themes/advanced/skins/default/ui.css')->addCss('css/styles.css', ' media="print" ')->addRss('RSS Feed', 'http://example.com/feed.xml')->addLinkRel('next', 'http://example.com/page1.html')->addJs('varien/form.js', '', 'lt IE 7'); $this->assertEquals('<script type="text/javascript" src="http://localhost/pub/lib/varien/js.js"></script>' . "\n" . '<script type="text/javascript" ' . 'src="http://localhost/pub/media/skin/frontend/default/default/default/en_US/Mage_Bundle/bundle.js">' . '</script>' . "\n" . '<link rel="stylesheet" type="text/css" media="all"' . ' href="http://localhost/pub/lib/tiny_mce/themes/advanced/skins/default/ui.css" />' . "\n" . '<link rel="stylesheet" type="text/css" media="print" ' . 'href="http://localhost/pub/media/skin/frontend/default/default/default/en_US/css/styles.css" />' . "\n" . '<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="http://example.com/feed.xml" />' . "\n" . '<link rel="next" href="http://example.com/page1.html" />' . "\n" . '<!--[if lt IE 7]>' . "\n" . '<script type="text/javascript" src="http://localhost/pub/lib/varien/form.js"></script>' . "\n" . '<![endif]-->' . "\n", $this->_block->getCssJsHtml()); }