Exemple #1
0
 public function testGetAffectedFields()
 {
     $valueId = 2345;
     $attributeId = 345345;
     $attribute = $this->getMock('Magento\\Eav\\Model\\Entity\\Attribute\\AbstractAttribute', ['getBackendTable', 'isStatic', 'getAttributeId', 'getName', '__wakeup'], [], '', false);
     $attribute->expects($this->any())->method('getName')->will($this->returnValue('image'));
     $attribute->expects($this->any())->method('getAttributeId')->will($this->returnValue($attributeId));
     $attribute->expects($this->any())->method('isStatic')->will($this->returnValue(false));
     $attribute->expects($this->any())->method('getBackendTable')->will($this->returnValue('table'));
     $this->model->setAttribute($attribute);
     $object = new \Magento\Framework\Object();
     $object->setImage(['images' => [['value_id' => $valueId]]]);
     $object->setId(555);
     $this->assertEquals(['table' => [['value_id' => $valueId, 'attribute_id' => $attributeId, 'entity_id' => $object->getId()]]], $this->model->getAffectedFields($object));
 }
 /**
  * {@inheritdoc}
  */
 public function getAffectedFields($object)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getAffectedFields');
     if (!$pluginInfo) {
         return parent::getAffectedFields($object);
     } else {
         return $this->___callPlugins('getAffectedFields', func_get_args(), $pluginInfo);
     }
 }