Пример #1
0
 public function testGetValue()
 {
     $html = '<p>test</p>';
     $text = 'test';
     $this->_model->setData(array('code' => 'test_code', 'html_value' => $html, 'plain_value' => $text));
     $this->assertEquals($html, $this->_model->getValue());
     $this->assertEquals($html, $this->_model->getValue(\Magento\Core\Model\Variable::TYPE_HTML));
     $this->assertEquals($text, $this->_model->getValue(\Magento\Core\Model\Variable::TYPE_TEXT));
 }
Пример #2
0
 /**
  * Load variable by code
  *
  * @param \Magento\Core\Model\Variable $object
  * @param string $code
  * @return $this
  */
 public function loadByCode(\Magento\Core\Model\Variable $object, $code)
 {
     if ($result = $this->getVariableByCode($code, true, $object->getStoreId())) {
         $object->setData($result);
     }
     return $this;
 }