예제 #1
0
 public function testAddRss()
 {
     $this->_pageAssets->expects($this->once())->method('add')->with('link/http://127.0.0.1/test.rss', $this->isInstanceOf('Magento\\Framework\\View\\Asset\\Remote'), array('attributes' => 'rel="alternate" type="application/rss+xml" title="RSS Feed"'));
     $assetRemoteFile = $this->getMock('Magento\\Framework\\View\\Asset\\Remote', array(), array(), '', false);
     $this->_objectManager->expects($this->once(''))->method('create')->with('Magento\\Framework\\View\\Asset\\Remote')->will($this->returnValue($assetRemoteFile));
     $this->_block->addRss('RSS Feed', 'http://127.0.0.1/test.rss');
 }
예제 #2
0
 /**
  * @magentoAppIsolation enabled
  * @magentoConfigFixture current_store dev/js/merge_files 0
  * @magentoConfigFixture current_store dev/js/minify_files 0
  */
 public function testGetCssJsHtml()
 {
     $this->_block->addChild('zero.js', 'Magento\\Theme\\Block\\Html\\Head\\Script', array('file' => 'zero.js', 'properties' => array('flag_name' => 'nonexisting_condition')));
     $this->_block->addChild('varien/js.js', 'Magento\\Theme\\Block\\Html\\Head\\Script', array('file' => 'varien/js.js'));
     $this->_block->addChild('Magento_Bundle::bundle.js', 'Magento\\Theme\\Block\\Html\\Head\\Script', array('file' => 'Magento_Bundle::bundle.js'));
     $this->_block->addChild('ui.css', 'Magento\\Theme\\Block\\Html\\Head\\Css', array('file' => 'tiny_mce/themes/advanced/skins/default/ui.css'));
     $this->_block->addChild('styles.css', 'Magento\\Theme\\Block\\Html\\Head\\Css', array('file' => 'css/styles.css', 'properties' => array('attributes' => 'media="print"')));
     $this->_block->addRss('RSS Feed', 'http://example.com/feed.xml');
     $this->_block->addChild('magento-page-head-canonical-link', 'Magento\\Theme\\Block\\Html\\Head\\Link', array('url' => 'http://localhost/index.php/category.html', 'properties' => array('attributes' => array('rel' => 'next'))));
     $this->_block->addChild('varien/form.js', 'Magento\\Theme\\Block\\Html\\Head\\Script', array('file' => 'varien/form.js', 'properties' => array('ie_condition' => 'lt IE 7')));
     $this->assertEquals('<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="http://example.com/feed.xml" />' . "\n" . '<script type="text/javascript"' . ' src="http://localhost/pub/static/frontend/Magento/blank/en_US/varien/js.js"></script>' . "\n" . '<script type="text/javascript"' . ' src="http://localhost/pub/static/frontend/Magento/blank/en_US/Magento_Bundle/bundle.js">' . '</script>' . "\n" . '<link rel="stylesheet" type="text/css" media="all"' . ' href="http://localhost/pub/static/frontend/Magento/blank/en_US/' . 'tiny_mce/themes/advanced/skins/default/ui.css" />' . "\n" . '<link rel="stylesheet" type="text/css" media="print" ' . 'href="http://localhost/pub/static/frontend/Magento/blank/en_US/css/styles.css" />' . "\n" . '<link rel="next" href="http://localhost/index.php/category.html" />' . "\n" . '<!--[if lt IE 7]>' . "\n" . '<script type="text/javascript"' . ' src="http://localhost/pub/static/frontend/Magento/blank/en_US/varien/form.js"></script>' . "\n" . '<![endif]-->' . "\n", $this->_block->getCssJsHtml());
 }