/**
  * @return \Closure
  */
 protected function createZoneCalculatorsNormalizer()
 {
     return function (Options $options, $calculators) {
         $normalized = [];
         foreach ($calculators as $calculator) {
             if (!$calculator instanceof ZoneCalculator) {
                 $calculator = new ZoneCalculator($calculator);
             }
             $normalized[$calculator->getName()] = $calculator;
         }
         return $normalized;
     };
 }
 /**
  * @dataProvider provideCalculateException
  */
 public function testGetPriceException($exceptionMessage, $weight)
 {
     $this->setExpectedException(ViolationException::class, $exceptionMessage);
     $zoneCalculator = new ZoneCalculator(['name' => 1, 'weight_prices' => []]);
     $zoneCalculator->calculate($weight);
 }