コード例 #1
0
 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();
 }
コード例 #2
0
ファイル: PriceTest.php プロジェクト: andrewhowdencom/m2onk8s
 /**
  * @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());
 }