/**
  * @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($exceptionClass, $exceptionMessage, $weight)
 {
     $this->setExpectedException($exceptionClass, $exceptionMessage);
     $zoneCalculator = new ZoneCalculator(['name' => 1, 'weight_prices' => []]);
     $zoneCalculator->calculate($weight);
 }