Exemple #1
0
 public function testAddToParentGroup()
 {
     list($blocks, ) = $this->_createSampleBlocks(2);
     $this->_block->append($blocks[0], 'block1')->append($blocks[1], 'block2');
     $blocks[0]->addToParentGroup('group');
     $blocks[1]->addToParentGroup('group');
     $group = $this->_block->getChildGroup('group');
     $this->assertArrayHasKey('block1', $group);
     $this->assertArrayHasKey('block2', $group);
     $this->assertSame($group['block1'], $blocks[0], 'The same instance is expected.');
     $this->assertSame($group['block2'], $blocks[1], 'The same instance is expected.');
 }
Exemple #2
0
 protected function appendGeneralBlock(Mage_Core_Block_Abstract $block)
 {
     if ($this->generalBlockWasAppended) {
         return;
     }
     $generalBlockPath = Ess_M2ePro_Helper_View::GENERAL_BLOCK_PATH;
     $blockGeneral = $this->getLayout()->createBlock($generalBlockPath);
     $block->append($blockGeneral);
     $this->generalBlockWasAppended = true;
 }