function testNotInEnabledCategory() { $product = $this->getMock('Elite_Vaf_Model_Catalog_Product', array('getCategoryIds')); $product->expects($this->any())->method('getCategoryIds')->will($this->returnValue(array(1, 3))); $filter = new Elite_Vaf_Model_Catalog_Category_FilterImpl(); $filter->setConfig(new Zend_Config(array('category' => array('whitelist' => 2)))); $this->assertFalse($product->isInEnabledCategory($filter)); }
function getFilter() { if (!$this->filter instanceof Elite_Vaf_Model_Catalog_Category_Filter) { $this->filter = new Elite_Vaf_Model_Catalog_Category_FilterImpl(); $this->filter->setConfig($this->getConfig()); } return $this->filter; }
function getLoadedProductCollection() { $collection = $this->_getProductCollection(); $filter = new Elite_Vaf_Model_Catalog_Category_FilterImpl(); $category = Mage::registry('current_category'); if (!is_object($category)) { return $collection; } $category_id = $category->getId(); if ($filter->shouldShow($category_id)) { $this->applyNames($collection); } return $collection; }
protected function getFilter($config) { $filter = new Elite_Vaf_Model_Catalog_Category_FilterImpl(); $filter->setConfig(new Zend_Config(array('category' => $config))); return $filter; }