public matchAll ( CommerceGuys\Addressing\AddressInterface $address, $scope = null ) | ||
$address | CommerceGuys\Addressing\AddressInterface |
/** * @covers ::matchAll * * @uses \CommerceGuys\Zone\Matcher\ZoneMatcher::__construct */ public function testMatchAll() { $address = $this->getMockBuilder('CommerceGuys\\Addressing\\Model\\Address')->disableOriginalConstructor()->getMock(); $zones = $this->matcher->matchAll($address); $this->assertCount(3, $zones); // de3 must come first because it has the highest priority. $this->assertEquals('de3', $zones[0]->getId()); // The other two zones have the same priority, so their order is // undefined and different between PHP and HHVM. $otherIds = []; $otherIds[] = $zones[1]->getId(); $otherIds[] = $zones[2]->getId(); $this->assertContains('de2', $otherIds); $this->assertContains('de', $otherIds); }