Пример #1
0
 /**
  * Tests if a set params array can be given back without a manipulation if
  * the input array gets manipulated from outside the class.
  */
 public function testSetAndManipulateSourceParams()
 {
     $params = array('name' => 'testuser', 'email' => '*****@*****.**', 'id' => 123);
     $expectedParams = $params;
     $this->request->setParams($params);
     $params['testvar'] = false;
     $actualParams = $this->request->getParams();
     $this->assertEquals($expectedParams, $actualParams, 'Param array got manipulated unexpectedly.');
 }
Пример #2
0
 /**
  * Returns a full url for the current url with only the given parts changed
  * @param array $urlParts
  * @param bool $resetParams
  * @param bool $secure
  * @return string
  */
 public function getCurrentUrl(array $urlParts = array(), $resetParams = true, $secure = false)
 {
     $currentUrlParts = array('module' => $this->request->getModuleName(), 'controller' => $this->request->getControllerName(), 'action' => $this->request->getActionName());
     $urlParams = array_merge($currentUrlParts, $resetParams ? array() : $this->request->getParams(), $urlParts);
     return $this->getUrl($urlParams, null, $secure);
 }