Assert that a query string parameter is present and has a given value.

@param  string  $name
@param  string  $value
@return $this
504178
public function assertQueryStringHas($name, $value = null)
    {
        $output = $this->assertHasQueryStringParameter($name);

        if (is_null($value)) {
            return $this;
        }

        $parsedOutputName = is_array($output[$name]) ? implode(',', $output[$name]) : $output[$name];

        $parsedValue = is_array($value) ? implode(',', $value) : $value;

        PHPUnit::assertEquals(
            $value, $output[$name],
            "Query string parameter [{$name}] had value [{$parsedOutputName}], but expected [{$parsedValue}]."
        );

        return $this;
    }
570464
public function set($name, $value=null)
    {   
        if ($name instanceof Query) {
            parent::set($name);
            return $this;
        } elseif (is_array($name)) {
            foreach ($name as $k => $v) {
                $this->set($k, $v);
            }
            return $this;
        } elseif (is_numeric($name)) {
            $this->set('where', $name);
            return $this;
        }
        
        if (!empty($value)) {
            if ($name == 'type') {
                $this->type($value);
            } elseif (in_array($name, array('distinct', 'group', 'having', 'order', 'limit', 'page', 'pagesize', 'start', 'result_key'))) {
                $this->data[$name] = is_array($value) ? $value : array($value);
            } elseif (in_array($name, ['set', 'values', 'data'])) { // data
                if (!isset($this->data[$name])) $this->data[$name] = [];
                
                if (is_array($value) && isset($value[0])) {
                    $this->data[$name] += $value;
                } else {
                    $this->data[$name][] = $value;
                }
            } elseif ($name == 'join' || $name == 'leftjoin') {
                $name = 'join';
                if (!isset($this->data[$name])) $this->data[$name] = [];
                if (is_array($value) && isset($value[0])) {
                    if (is_array($value[0]) || (isset($value[1]) && is_string($value[1]) && preg_match('/\s+as\s+/', $value[1])) ) {
                        $this->data[$name] += $value;
                    } else {
                        $this->data[$name][] = $value;
                    }
                } else {
                    $this->data[$name][] = $value;
                }
            } else {
                if ($name == 'select') { // select == fields
                    $this->type($name);
                    $name = 'fields';
                } elseif (in_array($name, ['insert', 'update', 'delete'])) { // table
                    $this->type($name);
                    $name = 'table';
                } elseif (in_array($name, ['table', 'from'])) {
                    $name = 'table';
                } elseif ($name == 'count') {
                    $this->data['count'] = 1;
                    $name = 'fields';
                    if (strpos($value, 'count') === false) $value = 'count(' . $value . ')';
                } 
                
                if (is_array($value)) {
                    $this->data[$name] = isset($this->data[$name]) ? array_merge($this->data[$name], $value) : $value;
                } else {
                    $this->data[$name][] = $value;
                }
            }
        } elseif (in_array($name, ['select', 'insert', 'update', 'delete'])) {
            $this->type($name);
        } elseif ($name == 'count') {
            $this->data['count'] = 1;
        }
        
        return $this;
    }
824271
final public function setParameter(string $name, $value) : self
    {
        $this->parameters[$name] = $value;
        return $this;
    }
582282
public function withSetting(string $name, $value): self
    {
        $this->settings[$name] = $value;
        return $this;
    }
1138433
protected function hasParameter(array $params, $name, $value = null)
    {
        $found = in_array($name, $params);
        if (is_null($value) || !$found) {
            return $found;
        }
        $paramValueIndex = array_search($name, $params) + 1;
        return isset($params[$paramValueIndex]) && ($params[$paramValueIndex] == $value);
    }
517435
public function set($name, $value = null)
	{
		is_null($name) or \Arr::set($this->data, $name, $value);

		return $this;
	}
1058140
public function setParam($name, $value): self
    {
        if (null === $name) {
            throw new \InvalidArgumentException('The argument name cannot be null.');
        }

        $this->params[$name] = $value;

        return $this;
    }
481407
public HttpServerRequestActionBuilder queryParam(String name, String value) {
        httpMessage.queryParam(name, value);
        return this;
    }
726904
public function setHeader($name, $value)
    {
        $this->response = $this->response->withHeader($name, $value);
        return $this;
    }
1118636
public function set($name, $value = null)
    {
        if ($name === 'value') {
            $value = htmlspecialchars($value);
        }
        parent::set($name, $value);

        return $this;
    }
520794
protected function set($name, $value)
    {
        if ($this->modified === null && $this->uid !== null) {
            $this->load();
        }

        $value = $this->validate($name, $value);

        if ($this->properties[$name]['value'] !== $value) {
            $this->properties[$name]['value'] = $value;
            $this->modified = true;
        }

        return $this;
    }
610989
public function setDefaultValue($name, $value)
    {
        if (!$this->hasParameter($name)) {
            $this->setParameter($name, $value);
        }

        return $this;
    }
793908
public function addParam($name, $value): self
    {
        if (!isset($this->params[$name])) {
            $this->setParam($name, $value);
        }

        return $this;
    }
423023
public function setHeader(string $name, string $value)
    {
        switch ($this->type) {
            case 'psr-7':
                $this->response = $this->response->withHeader($name, $value);
                break;

            case 'laravel':
            case 'symfony':
                $this->response->headers->set($name, $value);
                break;

            case 'thinkphp':
                $this->response->header($name, $value);
                break;

            default:
                $this->response[$name] = $value;
                break;
        }

        return $this;
    }
64884
public function addParam(string $name, $value): self
    {
        $this->parsedUri->queryString()->addParam($name, $value);
        return $this;
    }
78035
public function header( string $name, string $value )
      : Request
   {

      if ( \is_null( $value ) || ! \is_string( $value ) )
      {
         unset( $this->_defaultHeaders[ $name ] );
      }

      $this->_defaultHeaders[ $name ] = $value;

      return $this;

   }
557893
public function setParameterGet($name, $value = null)
    {
        if (is_array($name)) {
            foreach ($name as $k => $v) {
                $this->_setParameter('GET', $k, $v);
            }
        } else {
            $this->_setParameter('GET', $name, $value);
        }

        return $this;
    }