assertEquals($expectedGroupedFields, AddressFormatHelper::getGroupedFields($format)); $fieldOverrides = new FieldOverrides([ AddressField::ORGANIZATION => FieldOverride::HIDDEN, AddressField::LOCALITY => FieldOverride::HIDDEN, ]); $expectedGroupedFields = [ [AddressField::GIVEN_NAME, AddressField::FAMILY_NAME], [AddressField::ADDRESS_LINE1], [AddressField::ADDRESS_LINE2], [AddressField::POSTAL_CODE], ]; $this->assertEquals($expectedGroupedFields, AddressFormatHelper::getGroupedFields($format, $fieldOverrides)); } /** * @covers ::getRequiredFields */ public function testGetRequiredFields() { $addressFormat = new AddressFormat([ 'country_code' => 'US', 'format' => "%givenName %familyName\n%organization\n%addressLine1\n%addressLine2\n%locality, %administrativeArea %postalCode", 'required_fields' => [ AddressField::ADMINISTRATIVE_AREA, AddressField::LOCALITY, AddressField::POSTAL_CODE, ], ]); $fieldOverrides = new FieldOverrides([]); $expectedRequiredFields = [ AddressField::ADMINISTRATIVE_AREA, AddressField::LOCALITY, AddressField::POSTAL_CODE, ]; $this->assertEquals($expectedRequiredFields, AddressFormatHelper::getRequiredFields($addressFormat, $fieldOverrides)); $fieldOverrides = new FieldOverrides([ AddressField::ADMINISTRATIVE_AREA => FieldOverride::HIDDEN, AddressField::POSTAL_CODE => FieldOverride::OPTIONAL, AddressField::ADDRESS_LINE1 => FieldOverride::REQUIRED, ]); $expectedRequiredFields = [ AddressField::LOCALITY, AddressField::ADDRESS_LINE1, ]; $this->assertEquals($expectedRequiredFields, AddressFormatHelper::getRequiredFields($addressFormat, $fieldOverrides)); } } __halt_compiler();----SIGNATURE:----mvlhfyCYJdwTdsa024Bmu3vFw1zuV1wjckP6xRWNW8ojvigyb6dTYsSIXBp9WZWyoM/CioKVx5w1do9MFEflKDLZM6CgO4YQJ6tdMRfOMrqvWBBY/e5H5wTWlP8edZYKtBy2Sq4dKeIBL4eM+g+LXpMRM4jUcpSSvYsRbCuFGkc8MAgX3HkOV6RZY8KfCV0L4aB00XpiMGj5u0E+KVOJ3B6ozeP0rluOQhHTb6bknenL8/2v42fnv3HYkNFkaVZh++OT8XPuvP/DN5DRRqcQz2BVwJPU5RK/4qViXwQY5BcwcT6HR7W0AYJegJWRKLjon8LlEv89D0w6+R3OJRVk29K7HSsecF4LqvW6OXI00kquh6I28G3xMpdeTjxiFo7DVMpk9uph+wHs2lzUkqLPuQ6wP/yB7WEDuD/95GcULWgBgFPzZ33pbUHZECTbzb0Xc8EvhDxzrp2WEktqRU0EUn5movyd+aE6fMAfFt7ovydGIWSUfQJbK0Dv5fqvHoeFBf4Sb596JlSX7vCYnLBk6EO547z+BL13xT6ufW9oS6Jv9bkb1/lacEYzZvncU1jk2Aqms6gyzbl2voaSIZdmWoUJqB8dc9qtlicqcn5WGYB/uVxi3eeKVDOEC/mfZwAYBgfQK5sdYGq7ZcK2FL6vvRKM/coJfX7IXDMJlNg0w84=----ATTACHMENT:----NjM3MDU1NTY5OTgxMzY0MCA0Nzk2MDk1ODQ3ODkwOTQzIDg1NTc4NjU0MjE4MzQxMDY=