/**
  * @param string $displayType
  * @param bool $pagerEnable
  * @param int $productsCount
  * @param int $productsPerPage
  */
 protected function startTestGetProductCollection($displayType, $pagerEnable, $productsCount, $productsPerPage)
 {
     $productCollectionFactory = $this->getMock('Magento\\Catalog\\Model\\ResourceModel\\Product\\CollectionFactory', ['create'], [], '', false, false);
     $productCollectionFactory->expects($this->atLeastOnce())->method('create')->willReturn($this->productCollection);
     $this->block = $this->objectManager->getObject('Magento\\Catalog\\Block\\Product\\Widget\\NewWidget', ['context' => $this->context, 'productCollectionFactory' => $productCollectionFactory]);
     if (null === $productsPerPage) {
         $this->block->unsetData('products_per_page');
     } else {
         $this->block->setData('products_per_page', $productsPerPage);
     }
     $this->block->setData('show_pager', $pagerEnable);
     $this->block->setData('display_type', $displayType);
     $this->block->setProductsCount($productsCount);
     $this->block->toHtml();
 }
Exemple #2
0
 /**
  * {@inheritdoc}
  */
 public function unsetData($key = null)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'unsetData');
     if (!$pluginInfo) {
         return parent::unsetData($key);
     } else {
         return $this->___callPlugins('unsetData', func_get_args(), $pluginInfo);
     }
 }