protected function setUp() { $category = new Mage_Catalog_Model_Category(); $category->load(4); $attribute = new Mage_Catalog_Model_Entity_Attribute(); $attribute->loadByCode('catalog_product', 'weight'); $this->_model = new Mage_Catalog_Model_Layer_Filter_Decimal(); $this->_model->setData(array('layer' => new Mage_Catalog_Model_Layer(array('current_category' => $category)), 'attribute_model' => $attribute)); }
protected function setUp() { $category = Mage::getModel('Mage_Catalog_Model_Category'); $category->load(4); /** @var $attribute Mage_Catalog_Model_Entity_Attribute */ $attribute = Mage::getModel('Mage_Catalog_Model_Entity_Attribute'); $attribute->loadByCode('catalog_product', 'weight'); $this->_model = Mage::getModel('Mage_Catalog_Model_Layer_Filter_Decimal'); $this->_model->setData(array('layer' => Mage::getModel('Mage_Catalog_Model_Layer', array('data' => array('current_category' => $category))), 'attribute_model' => $attribute)); }