For performance reasons the list of EU countries is hardcoded, avoiding
the need to create and call 28 ZoneMemberCountry instances.
/** * @covers ::match * * @uses \CommerceGuys\Zone\Model\ZoneMemberEu::__construct */ public function testMatch() { $mockBuilder = $this->getMockBuilder('CommerceGuys\\Addressing\\Address')->disableOriginalConstructor(); $frenchAddress = $mockBuilder->getMock(); $frenchAddress->expects($this->any())->method('getCountryCode')->will($this->returnValue('FR')); $serbianAddress = $mockBuilder->getMock(); $serbianAddress->expects($this->any())->method('getCountryCode')->will($this->returnValue('RS')); $this->assertEquals(true, $this->zoneMember->match($frenchAddress)); $this->assertEquals(false, $this->zoneMember->match($serbianAddress)); }