예제 #1
0
 public function testSetTemplateNoProduct()
 {
     $this->_helper->expects($this->once())->method('isStockAlertAllowed')->will($this->returnValue(true));
     $this->_helper->expects($this->never())->method('getSaveUrl');
     $this->_registry->expects($this->any())->method('registry')->with('current_product')->will($this->returnValue(null));
     $this->_block->setLayout($this->_layout);
     $this->_block->setTemplate('path/to/template.phtml');
     $this->assertEquals('', $this->_block->getTemplate());
     $this->assertNull($this->_block->getSignupUrl());
 }
예제 #2
0
파일: Email.php 프로젝트: nja78/magento2
 /**
  * Retrieve stock block
  *
  * @return \Magento\ProductAlert\Block\Email\Stock
  */
 protected function _getStockBlock()
 {
     if ($this->_stockBlock === null) {
         $this->_stockBlock = $this->_productAlertData->createBlock('Magento\\ProductAlert\\Block\\Email\\Stock');
     }
     return $this->_stockBlock;
 }