CommerceGuys\Zone\Tests\PostalCodeHelperTest::getAddress PHP Method

getAddress() protected method

Returns a mock address with the provided postal code.
protected getAddress ( string $postalCode = null ) : Address
$postalCode string The postal code.
return CommerceGuys\Addressing\Address
    protected function getAddress($postalCode = null)
    {
        $address = $this->getMockBuilder('CommerceGuys\\Addressing\\Address')->getMock();
        if ($postalCode) {
            $address->expects($this->any())->method('getPostalCode')->will($this->returnValue($postalCode));
        }
        return $address;
    }
PostalCodeHelperTest