Example #1
0
 /**
  * Sets GET values method
  *
  * @param  string|array $spec
  * @param  null|mixed   $value
  * @return Zend_Controller_Request_Http
  */
 public function setQuery($spec, $value = null)
 {
     if (!is_array($spec) && $value === null) {
         unset($_GET[$spec]);
         return $this;
     }
     return parent::setQuery($spec, $value);
 }
Example #2
0
 public function testIsValidGetTrueWithQuery()
 {
     $request = new Zend_Controller_Request_HttpTestCase();
     $request->setMethod('get');
     $request->setQuery(array('foo' => 'bar'));
     Zend_Controller_Front::getInstance()->setRequest($request);
     $helper = new Waf_Zend_Controller_Action_Helper_Action_FormTest_TestFormHelper_GetDefault();
     $this->assertTrue($helper->isValidGet());
 }
 /**
  * Simulates Query (GET) parameters.
  *
  * Example:
  *
  *     $this->setGet(array('page' => 1));
  *
  * Additionally, it is possible to use a form instance
  * as data source:
  *
  *     $form = new Zend_Form();
  *     $form->populate(array('name' => 'Matthias'));
  *     $this->setGet($form);
  *
  * @param array(string=>mixed)|Zend_Form $arrayOrForm
  */
 protected function setGet($arrayOrForm)
 {
     $this->request->setMethod('GET');
     $this->request->setQuery($this->toStrings($this->toValues($arrayOrForm)));
 }