public function testGetLoadedProductCollection() { $this->_block->setShowRootCategory(true); $collection = $this->_block->getLoadedProductCollection(); $this->assertInstanceOf('Magento\\Catalog\\Model\\ResourceModel\\Product\\Collection', $collection); /* Check that root category was defined for Layer as current */ $this->assertEquals(2, $this->_block->getLayer()->getCurrentCategory()->getId()); }
/** * {@inheritdoc} */ public function getLayer() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getLayer'); if (!$pluginInfo) { return parent::getLayer(); } else { return $this->___callPlugins('getLayer', func_get_args(), $pluginInfo); } }