get('ES'); // Confirm that the right class has been returned, a known value has // been successfully populated, and defaults have been merged. $this->assertInstanceOf(AddressFormat::class, $addressFormat); $this->assertEquals('ES', $addressFormat->getCountryCode()); $this->assertEquals(AdministrativeAreaType::PROVINCE, $addressFormat->getAdministrativeAreaType()); $this->assertEquals(LocalityType::CITY, $addressFormat->getLocalityType()); $this->assertEquals(PostalCodeType::POSTAL, $addressFormat->getPostalCodeType()); $this->assertEquals('\\d{5}', $addressFormat->getPostalCodePattern()); // Confirm that passing a lowercase country code works. $anotherAddressFormat = $addressFormatRepository->get('es'); $this->assertSame($anotherAddressFormat, $addressFormat); } /** * @covers ::get * @covers ::processDefinition * @covers ::getGenericDefinition * @covers ::getDefinitions */ public function testGetNonExistingAddressFormat() { $addressFormatRepository = new AddressFormatRepository(); $addressFormat = $addressFormatRepository->get('ZZ'); $this->assertEquals('ZZ', $addressFormat->getCountryCode()); } /** * @covers ::getAll * @covers ::processDefinition * @covers ::getGenericDefinition * @covers ::getDefinitions */ public function testGetAll() { $addressFormatRepository = new AddressFormatRepository(); $addressFormats = $addressFormatRepository->getAll(); $this->assertArrayHasKey('ES', $addressFormats); $this->assertArrayHasKey('RS', $addressFormats); $this->assertEquals('ES', $addressFormats['ES']->getCountryCode()); $this->assertEquals(LocalityType::CITY, $addressFormats['ES']->getLocalityType()); $this->assertEquals('RS', $addressFormats['RS']->getCountryCode()); $this->assertEquals(LocalityType::CITY, $addressFormats['RS']->getLocalityType()); } } __halt_compiler();----SIGNATURE:----1fTYkthw8JkpzTrCoBC+TowupV4I577OsNx8t3LeIRZUytZnugpMjYpHJeYV+Q48AFKMca6LXpd9qGtukwjvL2du1DXYXcWF7YEi+2Bgp1VAjMns7XusABtdcfW1zluBD3YYqKCtBIBIw7pFje6MD2xMivpLoeBeeNFpvL+xxC0sRctNQnsWYU0QHX7l4AY64hHLC51y2p3xSH8V9Vmu1LF7GLA1jqpffhPZGoyK6Yemz0JtmTFSisiK/n6Euh0t7WjT9+vN2mpJqZEmwMXCByRcPsNQCVzdEX4JZyo6fKPlAJQIKMioGPpa+5JixLoJ3iVC11Fv9qphwtRd4iQ+whVmX7cHhCoS/naE08Y56Nw7K0+TV434evb4kePmLcaVIIqysbyvnKK8iO6sCObh6P4+Rz72tNOMFgH54GkWh3XXKpVF+kcGB2zSUIRRc3b69j4gkaW6bbgvcqlI05LVRs8cL2BhlCRNbaZHcUUd1hLaUf53ow0+2oLSqqFe1IvYH/LdEgETGMYADpMpXIdFd01WsVu952WfLHtlED8LL3Lzy4x2GyAAXLkl+yD/TXc0R2MMOPFVEWTys5mQZTjxkroVhTac2+VoeZzDSKTwSy7Yln4Gq4pY8wSt0WVOcXmHlaSrp0za0f5ig4kHUb2iVeDeUYpvsI6Xe6wKMvIe1cQ=----ATTACHMENT:----MjkxMTg2NDkzNzgxODY4MCA0MjI5OTU0NjM1NTMxMzcyIDE4ODQ5MjQ3ODU3NjE4MTU=