コード例 #1
0
 public function testFindFirstAvailableMenu()
 {
     $user = $this->getMock('Mage_User_Model_User', array(), array(), '', false);
     $mockSession = $this->getMock('Mage_Backend_Model_Auth_Session', array('getUser', 'isAllowed'), array(), '', false);
     $mockSession->expects($this->any())->method('getUser')->will($this->returnValue($user));
     $this->_model->setSession($mockSession);
     $itemMock = $this->getMock('Mage_Backend_Model_Menu_Item', array(), array(), '', false);
     $itemMock->expects($this->once())->method('getAction')->will($this->returnValue('adminhtml/user'));
     $this->_menuMock->expects($this->any())->method('getFirstAvailable')->will($this->returnValue($itemMock));
     $this->assertEquals('adminhtml/user', $this->_model->findFirstAvailableMenu());
 }