CommerceGuys\Tax\Tests\Resolver\CanadaTaxTypeResolverTest::getContext PHP Method

getContext() protected method

Returns a mock context based on the provided data.
protected getContext ( CommerceGuys\Addressing\AddressInterface $customerAddress, CommerceGuys\Addressing\AddressInterface $storeAddress, array $storeRegistrations = [] ) : Context
$customerAddress CommerceGuys\Addressing\AddressInterface The customer address.
$storeAddress CommerceGuys\Addressing\AddressInterface The store address.
$storeRegistrations array The store registrations.
return CommerceGuys\Tax\Resolver\Context
    protected function getContext($customerAddress, $storeAddress, $storeRegistrations = [])
    {
        $context = $this->getMockBuilder('CommerceGuys\\Tax\\Resolver\\Context')->disableOriginalConstructor()->getMock();
        $context->expects($this->any())->method('getCustomerAddress')->will($this->returnValue($customerAddress));
        $context->expects($this->any())->method('getStoreAddress')->will($this->returnValue($storeAddress));
        $context->expects($this->any())->method('getStoreRegistrations')->will($this->returnValue($storeRegistrations));
        return $context;
    }