Ejemplo n.º 1
0
 public function testGetCommentsHtml()
 {
     $childBlock = $this->_layout->addBlock('Magento\\Framework\\View\\Element\\Text', 'creditmemo_comments', 'block');
     $expectedHtml = '<b>Any html</b>';
     $this->assertEmpty($childBlock->getEntity());
     $this->assertEmpty($childBlock->getTitle());
     $this->assertNotEquals($expectedHtml, $this->_block->getCommentsHtml($this->_creditmemo));
     $childBlock->setText($expectedHtml);
     $actualHtml = $this->_block->getCommentsHtml($this->_creditmemo);
     $this->assertSame($this->_creditmemo, $childBlock->getEntity());
     $this->assertNotEmpty($childBlock->getTitle());
     $this->assertEquals($expectedHtml, $actualHtml);
 }
Ejemplo 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 = [])
 {
     $this->_paymentHelper = $paymentHelper;
     $this->httpContext = $httpContext;
     parent::__construct($context, $registry, $data);
     $this->_isScopePrivate = true;
 }