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()); }