Example #1
0
 /**
  * Process metadata
  *
  * @param \Magento\Framework\View\Page\Config\Structure $pageStructure
  * @return $this
  */
 protected function processMetadata(Structure $pageStructure)
 {
     foreach ($pageStructure->getMetadata() as $name => $content) {
         $this->pageConfig->setMetadata($name, $content);
     }
     return $this;
 }
Example #2
0
 public function testMetadata()
 {
     $expectedMetadata = ['charset' => null, 'media_type' => null, 'content_type' => null, 'description' => null, 'keywords' => null, 'robots' => null, 'name' => 'test_value', 'html_encoded' => '<title><span class="test">Test</span></title>'];
     $this->model->setMetadata('name', 'test_value');
     $this->model->setMetadata('html_encoded', '<title><span class="test">Test</span></title>');
     $this->assertEquals($expectedMetadata, $this->model->getMetadata());
 }
 /**
  * {@inheritdoc}
  */
 public function setMetadata($name, $content)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'setMetadata');
     if (!$pluginInfo) {
         return parent::setMetadata($name, $content);
     } else {
         return $this->___callPlugins('setMetadata', func_get_args(), $pluginInfo);
     }
 }
Example #4
0
 public function testMetadata()
 {
     $expectedMetadata = [
         'charset' => null,
         'media_type' => null,
         'content_type' => null,
         'description' => null,
         'keywords' => null,
         'robots' => null,
         'name' => 'test_value',
     ];
     $this->model->setMetadata('name', 'test_value');
     $this->assertEquals($expectedMetadata, $this->model->getMetadata());
 }