Esempio n. 1
0
 public function testGetInvoiceCommentsHtml()
 {
     $childBlock = $this->_layout->addBlock('Magento\\Framework\\View\\Element\\Text', 'invoice_comments', 'block');
     $expectedHtml = '<b>Any html</b>';
     $this->assertEmpty($childBlock->getEntity());
     $this->assertEmpty($childBlock->getTitle());
     $this->assertNotEquals($expectedHtml, $this->_block->getInvoiceCommentsHtml($this->_invoice));
     $childBlock->setText($expectedHtml);
     $actualHtml = $this->_block->getInvoiceCommentsHtml($this->_invoice);
     $this->assertSame($this->_invoice, $childBlock->getEntity());
     $this->assertNotEmpty($childBlock->getTitle());
     $this->assertEquals($expectedHtml, $actualHtml);
 }
Esempio n. 2
0
 /**
  * @param \Magento\Framework\View\Element\Template\Context $context
  * @param \Magento\Framework\Registry $registry
  * @param \Magento\Framework\App\Http\Context $httpContext
  * @param \Magento\Payment\Helper\Data $paymentHelper
  * @param array $data
  */
 public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\App\Http\Context $httpContext, \Magento\Payment\Helper\Data $paymentHelper, array $data = array())
 {
     $this->_paymentHelper = $paymentHelper;
     $this->httpContext = $httpContext;
     parent::__construct($context, $registry, $data);
     $this->_isScopePrivate = true;
 }