public function testGetRowUrl() { $itemMock = $this->getMock('Varien_Object', array(), array(), '', false); $rowUrlGenerator = $this->getMock('Mage_Backend_Model_Widget_Grid_Row_UrlGenerator', array(), array(), '', false); $rowUrlGenerator->expects($this->once())->method('getUrl')->with($this->equalTo($itemMock))->will($this->returnValue('http://localhost/mng/item/edit')); $model = new Mage_Backend_Block_Widget_Grid_ColumnSet(array('layout' => $this->_layoutMock, 'helper' => $this->_helperMock, 'rowUrl' => array('generator' => $rowUrlGenerator))); $url = $model->getRowUrl($itemMock); $this->assertEquals('http://localhost/mng/item/edit', $url); }
public function testGetRowUrlIfUrlPathNotSet() { $this->assertEquals('#', $this->_block->getRowUrl(new StdClass())); }