コード例 #1
0
 /**
  * Check that secret key generation is based on usage of routeName extracted from request Forward info
  */
 public function testGetSecretKeyGenerationWithRouteNameInForwardInfo()
 {
     $routeName = 'adminhtml';
     $controllerName = 'catalog';
     $actionName = 'index';
     $keyFromParams = $this->_model->getSecretKey($routeName, $controllerName, $actionName);
     $this->_requestMock->expects($this->at(0))->method('getBeforeForwardInfo')->with('route_name')->will($this->returnValue('adminhtml'));
     $this->_requestMock->expects($this->at(1))->method('getBeforeForwardInfo')->with('route_name')->will($this->returnValue('adminhtml'));
     $this->_requestMock->expects($this->at(2))->method('getBeforeForwardInfo')->with('controller_name')->will($this->returnValue('catalog'));
     $this->_requestMock->expects($this->at(3))->method('getBeforeForwardInfo')->with('controller_name')->will($this->returnValue('catalog'));
     $this->_requestMock->expects($this->at(4))->method('getBeforeForwardInfo')->with('action_name')->will($this->returnValue('index'));
     $this->_requestMock->expects($this->at(5))->method('getBeforeForwardInfo')->with('action_name')->will($this->returnValue('index'));
     $this->_model->setRequest($this->_requestMock);
     $keyFromRequest = $this->_model->getSecretKey();
     $this->assertEquals($keyFromParams, $keyFromRequest);
 }