예제 #1
0
 /**
  * @param string $elementType
  * @param string $attributes
  *
  * @dataProvider elementAttributesDataProvider
  */
 public function testElementAttributes($elementType, $attributes)
 {
     foreach ($attributes as $attribute => $value) {
         $this->model->setElementAttribute($elementType, $attribute, $value);
     }
     $this->assertEquals($attributes, $this->model->getElementAttributes($elementType));
 }
예제 #2
0
 /**
  * Process all element attributes
  *
  * @param \Magento\Framework\View\Page\Config\Structure $pageStructure
  * @return $this
  */
 protected function processElementAttributes(Structure $pageStructure)
 {
     foreach ($pageStructure->getElementAttributes() as $element => $attributes) {
         foreach ($attributes as $name => $value) {
             $this->pageConfig->setElementAttribute($element, $name, $value);
         }
     }
     return $this;
 }
예제 #3
0
 /**
  * @param string $elementType
  * @param string $attribute
  * @param string $value
  *
  * @dataProvider elementAttributeDataProvider
  */
 public function testElementAttributes($elementType, $attribute, $value)
 {
     $this->model->setElementAttribute($elementType, $attribute, $value);
     $this->assertEquals([$attribute => $value], $this->model->getElementAttributes($elementType));
 }
예제 #4
0
 /**
  * {@inheritdoc}
  */
 public function setElementAttribute($elementType, $attribute, $value)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'setElementAttribute');
     if (!$pluginInfo) {
         return parent::setElementAttribute($elementType, $attribute, $value);
     } else {
         return $this->___callPlugins('setElementAttribute', func_get_args(), $pluginInfo);
     }
 }