示例#1
0
 public function testSetCustomAttribute()
 {
     $this->_addressBuilder->populateWithArray(array());
     $address = $this->_addressBuilder->setCustomAttribute('warehouse_zip', '78777')->setCustomAttribute('warehouse_alternate', '90051')->create();
     $this->assertEquals('78777', $address->getCustomAttribute('warehouse_zip')->getValue());
     $this->assertEquals('90051', $address->getCustomAttribute('warehouse_alternate')->getValue());
     foreach ($address->getCustomAttributes() as $customAttribute) {
         $attributes[Customer::CUSTOM_ATTRIBUTES_KEY][$customAttribute->getAttributeCode()] = [AttributeValue::ATTRIBUTE_CODE => $customAttribute->getAttributeCode(), AttributeValue::VALUE => $customAttribute->getValue()];
     }
     $this->assertEquals($attributes, $address->__toArray());
 }