Пример #1
0
 /**
  * Generate widget HTML if template variables are assigned
  *
  * @param string[] $construction
  * @return string
  */
 public function widgetDirective($construction)
 {
     if (!isset($this->_templateVars['subscriber'])) {
         return $construction[0];
     }
     $construction[2] .= sprintf(' store_id ="%s"', $this->getStoreId());
     return parent::widgetDirective($construction);
 }
Пример #2
0
 /**
  * @return void
  */
 public function testMediaDirective()
 {
     $image = 'wysiwyg/VB.png';
     $construction = ['{{media url="' . $image . '"}}', 'media', ' url="' . $image . '"'];
     $baseUrl = 'http://localhost/pub/media/';
     $this->storeMock->expects($this->once())->method('getBaseUrl')->with(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA)->willReturn($baseUrl);
     $this->storeManagerMock->expects($this->once())->method('getStore')->willReturn($this->storeMock);
     $result = $this->filter->mediaDirective($construction);
     $this->assertEquals($baseUrl . $image, $result);
 }