/** * @magentoConfigFixture current_store catalog/layered_navigation/price_range_calculation manual */ public function testApplyManual() { /** @var $objectManager \Magento\TestFramework\ObjectManager */ $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); /** @var $request \Magento\TestFramework\Request */ $request = $objectManager->get('Magento\\TestFramework\\Request'); $request->setParam('price', '10-20'); $this->_model->apply($request); }
public function testApply() { $priceId = '15-50'; $requestVar = 'test_request_var'; $this->target->setRequestVar($requestVar); $this->request->expects($this->exactly(1))->method('getParam')->will($this->returnCallback(function ($field) use($requestVar, $priceId) { $this->assertTrue(in_array($field, [$requestVar, 'id'])); return $priceId; })); $this->fulltextCollection->expects($this->once())->method('addFieldToFilter')->with('price')->will($this->returnSelf()); $this->target->apply($this->request); }