public function testSetListCollection() { $childBlock = $this->_layout->addBlock('Mage_Core_Block_Text', 'search_result_list', 'block'); $this->assertEmpty($childBlock->getCollection()); $this->_block->setListCollection(); $this->assertInstanceOf('Mage_CatalogSearch_Model_Resource_Advanced_Collection', $childBlock->getCollection()); }
/** * Search result cache, caches the child product list block * * @param Mage_CatalogSearch_Block_Advanced_Result $block */ public function applySearchResult(Mage_CatalogSearch_Block_Advanced_Result $block) { // The "messages" block is session-dependent, don't cache if (Mage::helper('cache')->responseHasMessages()) { $block->setData('cache_lifetime', null); return; } // We cache the product list child, not the result block itself $block->setCacheLifetime(null); // The toolbar needs to apply sort order etc $productListBlock = $block->getChild('search_result_list'); $this->applyProductList($productListBlock); }