Example #1
0
 protected function setUp()
 {
     $this->_layoutMock = $this->getMock('Mage_Core_Model_Layout', array(), array(), '', false);
     $this->_columnSetMock = $this->getMock('Mage_Backend_Block_Widget_Grid_ColumnSet', array(), $this->_prepareConstructorArguments());
     $returnValueMap = array(array('grid', 'grid.columnSet', 'grid.columnSet'), array('grid', 'reset_filter_button', 'reset_filter_button'), array('grid', 'search_button', 'search_button'));
     $this->_layoutMock->expects($this->any())->method('getChildName')->will($this->returnValueMap($returnValueMap));
     $this->_layoutMock->expects($this->any())->method('getBlock')->with('grid.columnSet')->will($this->returnValue($this->_columnSetMock));
     $this->_layoutMock->expects($this->any())->method('createBlock')->with('Mage_Backend_Block_Widget_Button')->will($this->returnValue(Mage::app()->getLayout()->createBlock('Mage_Backend_Block_Widget_Button')));
     $this->_block = Mage::app()->getLayout()->createBlock('Mage_Backend_Block_Widget_Grid');
     $this->_block->setLayout($this->_layoutMock);
     $this->_block->setNameInLayout('grid');
 }