/**
  * @magentoAppIsolation enabled
  */
 public function testProcessWithExceptions()
 {
     \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\App\\State')->setMode(State::MODE_DEFAULT);
     $this->layout->generateElements();
     $this->layout->addOutputElement('block.with.broken.constructor');
     $this->layout->addOutputElement('block.with.broken.layout');
     $this->layout->addOutputElement('block.with.broken.action');
     $this->assertEmpty($this->layout->getOutput());
 }
Esempio n. 2
0
 /**
  * @covers \Magento\Framework\View\Layout::addOutputElement
  * @covers \Magento\Framework\View\Layout::getOutput
  * @covers \Magento\Framework\View\Layout::removeOutputElement
  */
 public function testGetOutput()
 {
     $blockName = 'block_' . __METHOD__;
     $expectedText = "some_text_for_{$blockName}";
     $block = $this->_layout->addBlock('Magento\\Framework\\View\\Element\\Text', $blockName);
     $block->setText($expectedText);
     $this->_layout->addOutputElement($blockName);
     // add the same element twice should not produce output duplicate
     $this->_layout->addOutputElement($blockName);
     $this->assertEquals($expectedText, $this->_layout->getOutput());
     $this->_layout->removeOutputElement($blockName);
     $this->assertEmpty($this->_layout->getOutput());
 }
Esempio n. 3
0
 public function testAddRemoveOutputElement()
 {
     $this->assertSame($this->model, $this->model->addOutputElement('name'));
     $this->assertSame($this->model, $this->model->removeOutputElement('name'));
 }
Esempio n. 4
0
 /**
  * {@inheritdoc}
  */
 public function addOutputElement($name)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'addOutputElement');
     if (!$pluginInfo) {
         return parent::addOutputElement($name);
     } else {
         return $this->___callPlugins('addOutputElement', func_get_args(), $pluginInfo);
     }
 }