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()); }
/** * @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(); }
/** * 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()); }