public function testUpdate_withValidationErrors_onCountry() { $customer = Braintree\Customer::createNoValidate(); $address = Braintree\Address::createNoValidate(['customerId' => $customer->id, 'streetAddress' => '1 E Main St']); $result = Braintree\Address::update($customer->id, $address->id, ['countryCodeAlpha2' => 'MU', 'countryCodeAlpha3' => 'MYT']); $this->assertFalse($result->success); $countryErrors = $result->errors->forKey('address')->onAttribute('base'); $this->assertEquals(Braintree\Error\Codes::ADDRESS_INCONSISTENT_COUNTRY, $countryErrors[0]->code); }