public function testConfigValues()
 {
     $map = $this->getValueMap();
     $this->scopeConfig->expects($this->exactly(5))->method('getValue')->will($this->returnCallback(function ($key, $scope) use($map) {
         $this->assertArrayHasKey($key, $map);
         return $map[$key]['scope'] === $scope ? $map[$key]['value'] : null;
     }));
     $this->assertSame($map[Price::XML_PATH_RANGE_CALCULATION]['value'], $this->target->getRangeCalculationValue());
     $this->assertSame($map[Price::XML_PATH_RANGE_STEP]['value'], $this->target->getRangeStepValue());
     $this->assertSame($map[Price::XML_PATH_ONE_PRICE_INTERVAL]['value'], $this->target->getOnePriceIntervalValue());
     $this->assertSame($map[Price::XML_PATH_INTERVAL_DIVISION_LIMIT]['value'], $this->target->getIntervalDivisionLimitValue());
     $this->assertSame($map[Price::XML_PATH_RANGE_MAX_INTERVALS]['value'], $this->target->getRangeMaxIntervalsValue());
 }
Exemple #2
0
 /**
  * @SuppressWarnings(PHPMD.CamelCaseMethodName)
  *
  * {@inheritDoc}
  */
 protected function _renderRangeLabel($fromPrice, $toPrice)
 {
     $formattedPrice = $this->priceCurrency->format($fromPrice);
     if ($toPrice === '') {
         $formattedPrice = __('%1 and above', $formattedPrice);
     } elseif ($fromPrice != $toPrice || !$this->dataProvider->getOnePriceIntervalValue()) {
         $formattedPrice = __('%1 - %2', $formattedPrice, $this->priceCurrency->format($toPrice));
     }
     return $formattedPrice;
 }