diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/UpdateCustomerAddressTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/UpdateCustomerAddressTest.php index becc82eada316..60f1f2d64df90 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/UpdateCustomerAddressTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/UpdateCustomerAddressTest.php @@ -184,37 +184,27 @@ public function testUpdateCustomerAddressWithMissingAttribute() */ public function testUpdateCustomerAddressHasCustomAttributes() { - /** @var AddressRepositoryInterface $addressRepositoryInterface */ - $addressRepositoryInterface = Bootstrap::getObjectManager()->get(AddressRepositoryInterface::class); - /** @var \Magento\Customer\Api\Data\AddressInterface $address */ - $address = $addressRepositoryInterface->getById(1); - $address - ->setCustomAttribute('custom_attribute1', '') - ->setCustomAttribute('custom_attribute2', ''); - $addressRepositoryInterface->save($address); - $userName = 'customer@example.com'; $password = 'password'; $addressId = 1; - + $attributes = [ + [ + 'attribute_code' => 'custom_attribute1', + 'value'=> '[new-value1,new-value2]' + ], + [ + 'attribute_code' => 'custom_attribute2', + 'value'=> '"new-value3"' + ] + ]; + $attributesFragment = preg_replace('/"([^"]+)"\s*:\s*/', '$1:', json_encode($attributes)); $mutation = <<graphQlMutation($mutation, [], '', $this->getCustomerAuthHeaders($userName, $password)); - $actualCustomAttributes = $response['updateCustomerAddress']['custom_attributes']; - $this->assertEquals($actualCustomAttributes['0']['attribute_code'], 'custom_attribute1'); - $this->assertEquals($actualCustomAttributes['0']['value'], '[line1,line2]'); - $this->assertEquals($actualCustomAttributes['1']['attribute_code'], 'custom_attribute2'); - $this->assertEquals($actualCustomAttributes['1']['value'], 'line3'); + $this->assertEquals($attributes, $response['updateCustomerAddress']['custom_attributes']); } /**