Example #1
0
 public function testToHtmlPropagatesUrl()
 {
     \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\App\\State')->setAreaCode('frontend');
     $this->_block->setShouldPrepareInfoTabs(true);
     $childOne = $this->_layout->addBlock('Magento\\Framework\\View\\Element\\Text', 'child1', 'block');
     $this->_layout->addToParentGroup('child1', 'info_tabs');
     $childTwo = $this->_layout->addBlock('Magento\\Framework\\View\\Element\\Text', 'child2', 'block');
     $this->_layout->addToParentGroup('child2', 'info_tabs');
     $this->assertEmpty($childOne->getViewUrl());
     $this->assertEmpty($childTwo->getViewUrl());
     $this->_block->toHtml();
     $this->assertNotEmpty($childOne->getViewUrl());
     $this->assertNotEmpty($childTwo->getViewUrl());
 }