src/Context/ApiContext.php
public function setRequestFormParams(TableNode $table) {
        if (!isset($this->requestOptions['form_params'])) {
            $this->requestOptions['form_params'] = [];
        }

        foreach ($table as $row) {
            $name = $row['name'];
            $value = $row['value'];

            if (isset($this->requestOptions['form_params'][$name]) && !is_array($this->requestOptions['form_params'][$name])) {
                $this->requestOptions['form_params'][$name] = [$this->requestOptions['form_params'][$name]];
            }

            if (isset($this->requestOptions['form_params'][$name])) {
                $this->requestOptions['form_params'][$name][] = $value;
            } else {
                $this->requestOptions['form_params'][$name] = $value;
            }
        }

        return $this;
    }
public function setRequestFormParams(TableNode $table) {
        if (!isset($this->requestOptions['form_params'])) {
            $this->requestOptions['form_params'] = [];
        }

        foreach ($table as $row) {
            $name = $row['name'];
            $value = $row['value'];

            if (isset($this->requestOptions['form_params'][$name]) && !is_array($this->requestOptions['form_params'][$name])) {
                $this->requestOptions['form_params'][$name] = [$this->requestOptions['form_params'][$name]];
            }

            if (isset($this->requestOptions['form_params'][$name])) {
                $this->requestOptions['form_params'][$name][] = $value;
            } else {
                $this->requestOptions['form_params'][$name] = $value;
            }
        }

        return $this;
    }
public function setRequestFormParams ( TableNode $ table ) { if ( ! isset ( $ this -> requestOptions [ 'form_params' ] ) ) { $ this -> requestOptions [ 'form_params' ] = [ ] ; } foreach ( $ table as $ row ) { $ name = $ row [ 'name' ] ; $ value = $ row [ 'value' ] ; if ( isset ( $ this -> requestOptions [ 'form_params' ] [ $ name ] ) && ! is_array ( $ this -> requestOptions [ 'form_params' ] [ $ name ] ) ) { $ this -> requestOptions [ 'form_params' ] [ $ name ] = [ $ this -> requestOptions [ 'form_params' ] [ $ name ] ] ; } if ( isset ( $ this -> requestOptions [ 'form_params' ] [ $ name ] ) ) { $ this -> requestOptions [ 'form_params' ] [ $ name ] [ ] = $ value ; } else { $ this -> requestOptions [ 'form_params' ] [ $ name ] = $ value ; } } return $ this ; }
Set form parameters

@param TableNode $table Table with name / value pairs
@return self

@Given the following form parameters are set:
Set form parameters