Exemplo n.º 1
0
 public function testGetAffectedFields()
 {
     $valueId = 10;
     $attributeId = 42;
     $attribute = $this->getMock('Magento\\Eav\\Model\\Entity\\Attribute\\AbstractAttribute', ['getBackendTable', 'isStatic', 'getAttributeId', '__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'));
     $this->_model->setAttribute($attribute);
     $object = new \Magento\Framework\Object();
     $this->_model->setValueId($valueId);
     $this->assertEquals(['table' => [['value_id' => $valueId, 'attribute_id' => $attributeId]]], $this->_model->getAffectedFields($object));
 }
Exemplo n.º 2
0
 public function testGetAffectedFields()
 {
     $valueId = 10;
     $attributeId = 42;
     $attribute = $this->getMock('Mage_Eav_Model_Entity_Attribute_Abstract', array('getBackendTable', 'isStatic', 'getAttributeId'), array(), '', 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'));
     $this->_model->setAttribute($attribute);
     $object = new Varien_Object();
     $this->_model->setValueId($valueId);
     $this->assertEquals(array('table' => array(array('value_id' => $valueId, 'attribute_id' => $attributeId))), $this->_model->getAffectedFields($object));
 }
 public function testGetMappedSqlField()
 {
     $this->_condition->setAttribute('category_ids');
     $this->assertEquals('e.entity_id', $this->_condition->getMappedSqlField());
 }