public function testGetTemplateFilterWithEmptyValue() { $filterTemplate = $this->getMockBuilder('Magento\\Framework\\Filter\\Template')->setMethods(['setUseAbsoluteLinks', 'setStoreId'])->disableOriginalConstructor()->getMock(); $filterTemplate->expects($this->once())->method('setUseAbsoluteLinks')->will($this->returnSelf()); $filterTemplate->expects($this->once())->method('setStoreId')->will($this->returnSelf()); $this->filterFactory->method('create')->will($this->returnValue($filterTemplate)); $designConfig = $this->getMockBuilder('Magento\\Framework\\Object')->setMethods(['getStore'])->disableOriginalConstructor()->getMock(); $model = $this->getModelMock(['getUseAbsoluteLinks', 'getDesignConfig']); $model->expects($this->once())->method('getDesignConfig')->will($this->returnValue($designConfig)); $this->assertSame($filterTemplate, $model->getTemplateFilter()); }
/** * Get filter object for template processing log * * @return Filter */ public function getTemplateFilter() { if (empty($this->_templateFilter)) { $this->_templateFilter = $this->_emailFilterFactory->create(); $this->_templateFilter->setUseAbsoluteLinks($this->getUseAbsoluteLinks())->setStoreId($this->getDesignConfig()->getStore()); } return $this->_templateFilter; }