/** * @covers \Magento\Framework\View\Element\AbstractBlock::toHtml * @see testAssign() */ public function testToHtml() { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\App\\State')->setAreaCode('any area'); $this->assertEmpty($this->_block->toHtml()); $this->_block->setTemplate(uniqid('invalid_filename.phtml')); $this->assertEmpty($this->_block->toHtml()); }
/** * {@inheritdoc} */ public function toHtml() { if ($this->customerSession->isLoggedIn() || !$this->registration->isAllowed() || !$this->accountManagement->isEmailAvailable($this->getEmailAddress()) || !$this->validateAddresses()) { return ''; } return parent::toHtml(); }
public function toHtml() { if (!$this->getAddThisEnabled() || !$this->getAddThisPubId()) { return ''; } return parent::toHtml(); }
/** * {@inheritdoc} */ public function toHtml() { $isAutomaticAccount = $this->coreRegistry->registry('automatic_account'); if (!$isAutomaticAccount) { return ''; } return parent::toHtml(); }
/** * Initializes redirect template and set mark * @param Template $mark * * @return void */ protected function _initializeRedirectTemplateWithMark(Template $mark) { $this->setTemplate('Magento_Paypal::payment/redirect.phtml')->setRedirectMessage(__('You will be redirected to the PayPal website when you place an order.'))->setMethodTitle('')->setMethodLabelAfterHtml($mark->toHtml()); }