Exemplo n.º 1
0
 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));
 }
Exemplo n.º 2
0
 protected function setUp()
 {
     $attribute = new Mage_Catalog_Model_Entity_Attribute();
     $attribute->loadByCode('catalog_product', 'attribute_with_option');
     foreach ($attribute->getSource()->getAllOptions() as $optionInfo) {
         if ($optionInfo['label'] == 'Option Label') {
             $this->_attributeOptionId = $optionInfo['value'];
             break;
         }
     }
     $this->_model = new Mage_Catalog_Model_Layer_Filter_Attribute();
     $this->_model->setData(array('layer' => new Mage_Catalog_Model_Layer(), 'attribute_model' => $attribute));
 }