public function testGetProductCollection()
 {
     /** @var $collection \Magento\Catalog\Model\ResourceModel\Product\Collection */
     $collection = $this->_model->getProductCollection();
     $this->assertInstanceOf('Magento\\Catalog\\Model\\ResourceModel\\Product\\Collection', $collection);
     $ids = $collection->getAllIds();
     $this->assertEquals(2, count($ids));
     $this->assertSame($collection, $this->_model->getProductCollection());
 }
 /**
  * Retrieve list of filterable attributes
  *
  * @return array|\Magento\Catalog\Model\Resource\Product\Attribute\Collection
  */
 public function getList()
 {
     $setIds = $this->layer->getProductCollection()->getSetIds();
     if (!$setIds) {
         return array();
     }
     /** @var $collection \Magento\Catalog\Model\Resource\Product\Attribute\Collection */
     $collection = $this->collectionFactory->create();
     $collection->setItemObjectClass('Magento\\Catalog\\Model\\Resource\\Eav\\Attribute')->setAttributeSetFilter($setIds)->addStoreLabel($this->storeManager->getStore()->getId())->setOrder('position', 'ASC');
     $collection = $this->_prepareAttributeCollection($collection);
     $collection->load();
     return $collection;
 }
 /**
  * {@inheritdoc}
  */
 public function getProductCollection()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getProductCollection');
     if (!$pluginInfo) {
         return parent::getProductCollection();
     } else {
         return $this->___callPlugins('getProductCollection', func_get_args(), $pluginInfo);
     }
 }