示例#1
0
 public function testGetFaviconFile()
 {
     $storeMock = $this->getMock('\\Magento\\Store\\Model\\Store', array(), array(), '', false);
     $storeMock->expects($this->any())->method('getBaseUrl')->will($this->returnValue('baseUrl/'));
     $this->_context->getStoreManager()->expects($this->any())->method('getStore')->will($this->returnValue($storeMock));
     $this->_context->getScopeConfig()->expects($this->any())->method('getValue')->will($this->returnValue('scopeConfig'));
     $mediaDirMock = $this->getMock('\\Magento\\Framework\\Filesystem\\Directory\\Read', array(), array(), '', false);
     $mediaDirMock->expects($this->any())->method('isFile')->with('favicon/scopeConfig')->will($this->returnValue(true));
     $this->_context->getFilesystem()->expects($this->once())->method('getDirectoryRead')->will($this->returnValue($mediaDirMock));
     $this->assertEquals('baseUrl/favicon/scopeConfig', $this->_block->getFaviconFile());
 }
示例#2
0
文件: Head.php 项目: aiesh/magento2
 /**
  * @return array|string
  */
 public function getTitle()
 {
     /** Get default title */
     $title = parent::getTitle();
     /** Add default title */
     $this->_titles->add($title, true);
     /** Set title list */
     $this->setTitle(array_reverse($this->_titles->get()));
     /** Render titles */
     return parent::getTitle();
 }
示例#3
0
 /**
  * Test getRobots
  *
  * @magentoConfigFixture default_store design/search_engine_robots/default_robots INDEX,NOFOLLOW
  * @magentoAppIsolation enabled
  */
 public function testGetRobots()
 {
     $this->assertEquals('INDEX,NOFOLLOW', $this->_block->getRobots());
 }