public function testMergeDataObjectsCustomData() { $customer1Data = array('email' => '*****@*****.**', 'firstname' => 'John', 'lastname' => 'Doe', 'unknown_key' => 'Golden Necklace', Customer::CUSTOM_ATTRIBUTES_KEY => ['warehouse_zip' => [AttributeValue::ATTRIBUTE_CODE => 'warehouse_zip', AttributeValue::VALUE => '78777'], 'warehouse_alternate' => [AttributeValue::ATTRIBUTE_CODE => 'warehouse_alternate', AttributeValue::VALUE => '90051']]); $customer2Data = array('email' => '*****@*****.**', 'firstname' => 'John', 'lastname' => 'Johnson', 'unknown_key' => 'Golden Necklace', Customer::CUSTOM_ATTRIBUTES_KEY => ['warehouse_zip' => [AttributeValue::ATTRIBUTE_CODE => 'warehouse_zip', AttributeValue::VALUE => '78666']]); $expectedData = array('email' => '*****@*****.**', 'firstname' => 'John', 'lastname' => 'Johnson', Customer::CUSTOM_ATTRIBUTES_KEY => ['warehouse_zip' => [AttributeValue::ATTRIBUTE_CODE => 'warehouse_zip', AttributeValue::VALUE => '78666'], 'warehouse_alternate' => [AttributeValue::ATTRIBUTE_CODE => 'warehouse_alternate', AttributeValue::VALUE => '90051']]); $customer1 = $this->_customerBuilder->populateWithArray($customer1Data)->create(); $customer2 = $this->_customerBuilder->populateWithArray($customer2Data)->create(); $customer3 = $this->_customerBuilder->mergeDataObjects($customer1, $customer2); $this->assertEquals('78666', $customer3->getCustomAttribute('warehouse_zip')->getValue()); $this->assertEquals('90051', $customer3->getCustomAttribute('warehouse_alternate')->getValue()); foreach ($customer3->getCustomAttributes() as $customAttribute) { $this->assertEquals($expectedData[Customer::CUSTOM_ATTRIBUTES_KEY][$customAttribute->getAttributeCode()]['value'], $customAttribute->getValue()); } $this->assertEquals($expectedData, $customer3->__toArray()); }