Example #1
0
 /**
  * @param Mage_Core_Model_Layout $layout
  * @depends testSetChild
  */
 public function testReorderChild(Mage_Core_Model_Layout $layout)
 {
     $layout->addContainer('four', 'Four', array(), 'one');
     // offset +1
     $layout->reorderChild('one', 'four', 1);
     $this->assertSame(array('two', 'four', 'three'), $layout->getChildNames('one'));
     // offset -2
     $layout->reorderChild('one', 'three', 2, false);
     $this->assertSame(array('two', 'three', 'four'), $layout->getChildNames('one'));
     // after sibling
     $layout->reorderChild('one', 'two', 'three');
     $this->assertSame(array('three', 'two', 'four'), $layout->getChildNames('one'));
     // after everyone
     $layout->reorderChild('one', 'three', '-');
     $this->assertSame(array('two', 'four', 'three'), $layout->getChildNames('one'));
     // before sibling
     $layout->reorderChild('one', 'four', 'two', false);
     $this->assertSame(array('four', 'two', 'three'), $layout->getChildNames('one'));
     // before everyone
     $layout->reorderChild('one', 'two', '-', false);
     $this->assertSame(array('two', 'four', 'three'), $layout->getChildNames('one'));
 }