public function testApply() { $request = new Magento_Test_Request(); $request->setParam('decimal', '1,100'); $this->_model->apply($request, new Mage_Core_Block_Text()); $this->assertEquals(100, $this->_model->getData('range')); }
public function testApply() { $this->assertEmpty($this->_model->getLayer()->getState()->getFilters()); $request = new Magento_Test_Request(); $request->setParam('attribute', $this->_attributeOptionId); $this->_model->apply($request, new Mage_Core_Block_Text()); $this->assertNotEmpty($this->_model->getLayer()->getState()->getFilters()); }
public function testWithLimits() { $this->markTestIncomplete('Bug MAGE-6561'); $request = new Magento_Test_Request(); $request->setParam('price', '10-100'); $this->_prepareFilter($request); $this->assertEquals(array(0 => array('from' => 10, 'to' => 20, 'count' => 2), 1 => array('from' => 20, 'to' => 100, 'count' => 2)), $this->_model->calculateSeparators()); }
/** * @magentoDataFixture Mage/Catalog/_files/categories.php */ public function testGetRemoveUrl() { Mage::app()->getRequest()->setRoutingInfo(array('requested_route' => 'x', 'requested_controller' => 'y', 'requested_action' => 'z')); $request = new Magento_Test_Request(); $request->setParam('cat', 4); $this->_model->getFilter()->apply($request, new Mage_Core_Block_Text()); $this->assertStringEndsWith('/x/y/z/?cat=3', $this->_model->getRemoveUrl()); }
public function testApply() { $request = new Magento_Test_Request(); $request->setParam('cat', 3); $this->_model->apply($request, Mage::app()->getLayout()->createBlock('Mage_Core_Block_Text')); /** @var $category Mage_Catalog_Model_Category */ $category = Mage::registry('current_category_filter'); $this->assertInstanceOf('Mage_Catalog_Model_Category', $category); $this->assertEquals(3, $category->getId()); return $this->_model; }
/** * @magentoConfigFixture current_store catalog/layered_navigation/price_range_calculation manual */ public function testApplyManual() { $request = new Magento_Test_Request(); $request->setParam('price', '10-20'); $this->_model->apply($request, new Mage_Core_Block_Text()); $this->assertEquals(array(10, 20), $this->_model->getData('interval')); }