PHP Class CommerceGuys\Tax\Tests\Resolver\EuTaxTypeResolverTest

Inheritance: extends PHPUnit_Framework_TestCase
Show file Open project: commerceguys/tax

Protected Properties

Property Type Description
$taxTypes array Known tax types.
$zones array Note: The real fr_vat and de_vat zones are more complex, France excludes Corsica, Germany excludes Heligoland and Bussingen, but includes 4 Austrian postal codes. Those details were irrelevant for this test.

Public Methods

Method Description
dataProvider ( ) Provides data for the resolver test.
testConstructor ( )
testResolver ( $taxable, $context, $expected, $resolver )

Protected Methods

Method Description
getContext ( CommerceGuys\Addressing\AddressInterface $customerAddress, CommerceGuys\Addressing\AddressInterface $storeAddress, string $customerTaxNumber = '', array $storeRegistrations = [], DateTime $date = null ) : Context Returns a mock context based on the provided data.

Method Details

dataProvider() public method

Provides data for the resolver test.
public dataProvider ( )

getContext() protected method

Returns a mock context based on the provided data.
protected getContext ( CommerceGuys\Addressing\AddressInterface $customerAddress, CommerceGuys\Addressing\AddressInterface $storeAddress, string $customerTaxNumber = '', array $storeRegistrations = [], DateTime $date = null ) : Context
$customerAddress CommerceGuys\Addressing\AddressInterface The customer address.
$storeAddress CommerceGuys\Addressing\AddressInterface The store address.
$customerTaxNumber string The customer tax number.
$storeRegistrations array The store registrations.
$date DateTime The date.
return CommerceGuys\Tax\Resolver\Context

testConstructor() public method

public testConstructor ( )

testResolver() public method

public testResolver ( $taxable, $context, $expected, $resolver )

Property Details

$taxTypes protected property

Known tax types.
protected array $taxTypes
return array

$zones protected property

Note: The real fr_vat and de_vat zones are more complex, France excludes Corsica, Germany excludes Heligoland and Bussingen, but includes 4 Austrian postal codes. Those details were irrelevant for this test.
protected array $zones
return array