/**
  * @magentoAppIsolation enabled
  * @magentoDataFixture Magento/Catalog/_files/product_with_image.php
  */
 public function testImage()
 {
     \Magento\TestFramework\Helper\Bootstrap::getInstance()->loadArea(\Magento\Framework\App\Area::AREA_FRONTEND);
     \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\View\\DesignInterface')->setDefaultDesignTheme();
     $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Catalog\\Model\\Product');
     $product->load(1);
     $size = $this->_block->getImageSize();
     $this->assertGreaterThan(1, $size);
     $this->assertContains('/' . $size, $this->_block->getImageUrl($product));
     $this->assertStringEndsWith('magento_image.jpg', $this->_block->getImageUrl($product));
 }
Example #2
0
 /**
  * Prepare before to html
  *
  * @return string
  */
 protected function _toHtml()
 {
     if ($this->getItemCount()) {
         return parent::_toHtml();
     }
     return '';
 }
Example #3
0
 /**
  * Preparing global layout
  *
  * @return void
  */
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $headBlock = $this->getLayout()->getBlock('head');
     if ($headBlock) {
         $headBlock->setTitle(__('My Wish List'));
     }
 }
Example #4
0
 /**
  * Check whether wishlist item has description
  *
  * @param \Magento\Wishlist\Model\Item $item
  * @return bool
  */
 public function hasDescription($item)
 {
     $hasDescription = parent::hasDescription($item);
     if ($hasDescription) {
         return $item->getDescription() !== $this->_wishlistHelper->defaultCommentString();
     }
     return $hasDescription;
 }
Example #5
0
 /**
  * Prepare global layout
  *
  * @return $this
  *
  */
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $headBlock = $this->getLayout()->getBlock('head');
     if ($headBlock) {
         $headBlock->setTitle($this->getHeader());
     }
     return $this;
 }
Example #6
0
 /**
  * Retrieve block html
  *
  * @return string
  */
 protected function _toHtml()
 {
     if ($this->isEnabled()) {
         if (!$this->getLayout()) {
             return '';
         }
         foreach ($this->getLayout()->getChildBlocks($this->getNameInLayout()) as $child) {
             if ($child) {
                 $child->setItem($this->getItem());
             }
         }
         return parent::_toHtml();
     }
     return '';
 }
Example #7
0
 /**
  * Render block html
  *
  * @return string
  */
 protected function _toHtml()
 {
     $this->setOptionList($this->getConfiguredOptions());
     return parent::_toHtml();
 }
Example #8
0
 /**
  * @return string
  */
 protected function _toHtml()
 {
     if ($this->currentCustomer->getCustomerId()) {
         return parent::_toHtml();
     } else {
         return '';
     }
 }
Example #9
0
 /**
  * Retrieve Product View URL
  *
  * @param \Magento\Catalog\Model\Product $product
  * @param array $additional
  * @return string
  */
 public function getProductUrl($product, $additional = array())
 {
     $additional['_rss'] = true;
     return parent::getProductUrl($product, $additional);
 }
Example #10
0
 /**
  * Prepare global layout
  *
  * @return $this
  *
  */
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $this->pageConfig->getTitle()->set($this->getHeader());
     return $this;
 }