Exemple #1
0
 public function testSetGetProductsCount()
 {
     $this->assertEquals(\Magento\Catalog\Block\Product\NewProduct::DEFAULT_PRODUCTS_COUNT, $this->_block->getProductsCount());
     $this->_block->setProductsCount(100);
     $this->assertEquals(100, $this->_block->getProductsCount());
 }
Exemple #2
0
 /**
  * Retrieve how many products should be displayed
  *
  * @return int
  */
 public function getProductsCount()
 {
     if (!$this->hasData('products_count')) {
         return parent::getProductsCount();
     }
     return $this->getData('products_count');
 }