public function testGetPriceRangeWithRangeCalculation() { /** @var \Magento\Catalog\Model\Category|MockObject $category */ $category = $this->getMockBuilder('\\Magento\\Catalog\\Model\\Category')->disableOriginalConstructor()->setMethods(['getFilterPriceRange'])->getMock(); $priceRange = 0; $category->expects($this->once())->method('getFilterPriceRange')->will($this->returnValue($priceRange)); $this->coreRegistry->expects($this->once())->method('registry')->with('current_category_filter')->will($this->returnValue($category)); $maxPrice = 8000; $this->productCollection->expects($this->once())->method('getMaxPrice')->will($this->returnValue($maxPrice)); $this->target->getPriceRange(); }
/** * @magentoConfigFixture current_store catalog/layered_navigation/price_range_calculation manual * @magentoConfigFixture current_store catalog/layered_navigation/price_range_step 1.5 */ public function testGetPriceRangeManual() { // what you set is what you get $this->assertEquals(1.5, $this->_model->getPriceRange()); }