expectException(\InvalidArgumentException::class); $definition = [ 'id' => 'test', ]; $zone = new Zone($definition); } /** * @covers ::__construct */ public function testInvalidTerritories() { $this->expectException(\InvalidArgumentException::class); $definition = [ 'id' => 'test', 'label' => 'Test', 'territories' => 'WRONG', ]; $zone = new Zone($definition); } /** * @covers ::__construct * @covers ::getId * @covers ::getLabel * @covers ::getTerritories * @covers ::match */ public function testValid() { $definition = [ 'id' => 'de_fr', 'label' => 'Germany and France', 'territories' => [ ['country_code' => 'DE'], ['country_code' => 'FR'], ], ]; $zone = new Zone($definition); $this->assertEquals($definition['id'], $zone->getId()); $this->assertEquals($definition['label'], $zone->getLabel()); $this->assertCount(2, $zone->getTerritories()); $this->assertEquals($definition['territories'][0]['country_code'], $zone->getTerritories()[0]->getCountryCode()); $this->assertEquals($definition['territories'][1]['country_code'], $zone->getTerritories()[1]->getCountryCode()); $german_address = new Address('DE'); $serbian_address = new Address('RS'); $this->assertTrue($zone->match($german_address)); $this->assertFalse($zone->match($serbian_address)); } } __halt_compiler();----SIGNATURE:----l+dkcusNVR5RYoWfYdN1IZ/lSa/h+pSgJVjWrYUbxNP/sBxgLSubFSKejI3U70RjoIOw2y/pcIam5baDNvznP2cGTlVrsnoxPxz15GFlA1DSiagzY38WhOY5aR8+WX3MMAgCatZbKvfg3swSCwkHO04Ug9evUIlagwZfxt92Eo7z063kK7KuKVdktfXQpTxh/Q8wln0/MCqgMD/lITLwsUFK8czD/sRCcP8pg61qRS8kGUZdazgmt7P6rvXvFHT9cRsg9WDa/ZTNS4yVrjUUubIcVLPEScPVYEWtHgoZuALxwdXtu+AGO/ZBpx6UJE68Ycf+abJD4uP5A0hAZT6Ypgqp5pRzWpVbpZsb9D/I9DdPeasWWbEDlhGTBkcQpiq3K0JymBY4mj8abp5G85ZmqtvTV1hwezPG0dag/2INlBe91EvRfoWA+s9+ENCo5KnxLF8DhAShYNs9DEcwyqWqoiOX2kbTT8ZYYQvZP0osZadekLkksL/kJZoq5x7GJt0zeDEHxvYklJb5DUkaykF3yfFPl57KSE6+l+gY1WD5YYh8nCDLTgV3ghyTHYlUUF2F3p7Cg2E4lPNfFUvsLCvKw1Nzpkk28L6lXDWVK2YyKpGesUJCO6WfOHELvHnADv3fBxHVh3bWkGlGQ5/oifnNmOJtJWUaZjbPZpoYoIkrJDk=----ATTACHMENT:----OTkwNDIxMjY5NzUwODY2MSA0OTgwNDExNTQxOTgyOTUyIDEyNTIwMTQzNDY2MDU1NjI=