Ejemplo n.º 1
0
 protected function setUp()
 {
     $this->_gridMock = $this->getMock('Magento\\Backend\\Block\\Widget\\Grid', array('getId'), array(), '', false);
     $this->_gridMock->expects($this->any())->method('getId')->will($this->returnValue('test_grid'));
     $this->_layoutMock = $this->getMock('Magento\\Framework\\View\\Layout', array('getParentName', 'getBlock', 'helper'), array(), '', false, false);
     $this->_layoutMock->expects($this->any())->method('getParentName')->with('test_grid_massaction')->will($this->returnValue('test_grid'));
     $this->_layoutMock->expects($this->any())->method('getBlock')->with('test_grid')->will($this->returnValue($this->_gridMock));
     $this->_requestMock = $this->getMock('Magento\\Framework\\App\\Request\\Http', array(), array(), '', false);
     $this->_urlModelMock = $this->getMock('Magento\\Backend\\Model\\Url', array(), array(), '', false);
     $arguments = array('layout' => $this->_layoutMock, 'request' => $this->_requestMock, 'urlBuilder' => $this->_urlModelMock, 'data' => array('massaction_id_field' => 'test_id', 'massaction_id_filter' => 'test_id'));
     $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this);
     $this->_block = $objectManagerHelper->getObject('Magento\\Backend\\Block\\Widget\\Grid\\Massaction', $arguments);
     $this->_block->setNameInLayout('test_grid_massaction');
 }