Esempio n. 1
0
 public function testGetAffectedFields()
 {
     $valueId = 10;
     $attributeId = 42;
     $attribute = $this->getMock('Magento\\Eav\\Model\\Entity\\Attribute\\AbstractAttribute', ['getBackendTable', 'isStatic', 'getAttributeId', 'getName', '__wakeup'], [], '', false);
     $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'));
     $attribute->expects($this->any())->method('getName')->will($this->returnValue('group_price'));
     $this->_model->setAttribute($attribute);
     $object = new \Magento\Framework\Object();
     $object->setGroupPrice([['price_id' => 10]]);
     $object->setId(555);
     $this->assertEquals(['table' => [['value_id' => $valueId, 'attribute_id' => $attributeId, 'entity_id' => $object->getId()]]], $this->_model->getAffectedFields($object));
 }
Esempio n. 2
0
 /**
  * Add qty column
  *
  * @param array $columns
  * @return array
  */
 protected function _loadPriceDataColumns($columns)
 {
     $columns = parent::_loadPriceDataColumns($columns);
     $columns['price_qty'] = 'qty';
     return $columns;
 }