/** * @covers \CommerceGuys\Addressing\Formatter\PostalLabelFormatter */ public function testJapanAddressShippedFromFrance() { $address = new Address(); $address = $address->withCountryCode('JP')->withAdministrativeArea('Hokkaido')->withLocality('Some City')->withAddressLine1('Address Line 1')->withAddressLine2('Address Line 2')->withPostalCode('04')->withLocale('ja'); // Test a JP address formatted for sending from France. $expectedLines = ['JAPON - JAPAN', '〒04', '北海道Some City', 'Address Line 2', 'Address Line 1']; $this->formatter->setOriginCountryCode('FR'); $this->formatter->setLocale('fr'); $formattedAddress = $this->formatter->format($address); $this->assertFormattedAddress($expectedLines, $formattedAddress); }