Assert that the given select field has the given value selected.

@param  string  $field
@param  string  $value
@return $this
967348
public function assertSelected($field, $value)
    {
        PHPUnit::assertTrue(
            $this->selected($field, $value),
            "Expected value [{$value}] to be selected for [{$field}], but it wasn't."
        );

        return $this;
    }
1154363
public function set($field, $value)
    {
        $client = $this->getClient();

        $client->hset(
            $this->getKey()->getName(),
            $field,
            $value
        );

        // Integer reply, specifically:
        // 1 if field is a new field in the hash and value was set.
        // 0 if field already exists in the hash and the value was updated.

        return true;
    }
751954
public function whereInset($field, $value)
    {
        foreach ($this->queries as $query) {
            $query->whereInset($field, $value);
        }

        return $this;
    }
775138
public function whereNotContains($field, $value)
    {
        foreach ($this->queries as $query) {
            $query->whereNotContains($field, $value);
        }

        return $this;
    }
575801
private function FieldCondition($field, $value)
        {
            $tbl = $this->Table();
            $mapper = $this->FieldMapper($field);
            $dbVal = $mapper->ToDBString($value);
            
            $sql = $this->SqlBuilder();
            
            if ($dbVal === null)
                return $sql->IsNull($tbl->Field($field));
            else
                return $sql->Equals($tbl->Field($field), $sql->Value($dbVal));
        }
568484
final public function setRowFieldValue($field, $value)
    {

        //If value exists;
        if (array_key_exists($field, $this->schema)) {
            $this->schema[$field]->Value = $value;
            return true;
        }
        return false;
    }
294543
public function lookAt($value, $field)
    {
        $this->value = $value;
        $this->field = $field;
        return $this;

    }
200985
public function assertInputValue($field, $value)
    {
        PHPUnit::assertEquals(
            $value, $this->inputValue($field),
            "Expected value [{$value}] for the [{$field}] input does not equal the actual value [{$this->inputValue($field)}]."
        );

        return $this;
    }
795557
public function where($field, $value)
    {
        $this->reloadQueryAdapter();
        $this->activeQuery->where($field, $value);
        return $this;
    }
173186
public function addFilterBy(string $field, string $value): self
    {
        $this->filterBy[$field] = $value;

        return $this;
    }
1209084
public function setFieldValue($object, $field, $value)
    {
        $this->assertObjectInstance($object);

        return $this->getField($field)->set($object, $value);
    }
1197625
public function set($field, $value = null)
    {
        if (func_num_args() == 1) {
            if (is_array($field)) {
                foreach ($field as $key => $value) {
                    if ($key === '0' || $key === 0) {
                        $this->set($value);
                    } else {
                        $this->set($key, $value);
                    }
                }

                return $this;
            } elseif ($field instanceof self) {
                $this->data = $field->data;
                //$this->id = $field->id;

                return $this;
            } else {
                $value = $field;
                $field = $this->title_field;
            }
        }

        $field = $this->normalizeFieldName($field);

        $f = $this->hasField($field);

        try {
            if ($f && $this->hook('normalize', [$f, $value]) !== false) {
                $value = $f->normalize($value);
            }
        } catch (Exception $e) {
            $e->addMoreInfo('field', $field);
            $e->addMoreInfo('value', $value);
            $e->addMoreInfo('f', $f);

            throw $e;
        }

        $default_value = $f ? $f->default : null;

        $original_value = array_key_exists($field, $this->dirty) ? $this->dirty[$field] :
            ((isset($f) && isset($f->default)) ? $f->default : null);

        $current_value = array_key_exists($field, $this->data) ? $this->data[$field] : $original_value;

        if (gettype($value) == gettype($current_value) && $value == $current_value) {
            // do nothing, value unchanged
            return $this;
        }

        if ($f) {
            // perform bunch of standard validation here. This can be re-factored in the future.
            if ($f->read_only) {
                throw new Exception([
                    'Attempting to change read-only field',
                    'field' => $field,
                    'model' => $this,
                ]);
            }

            // enum property support
            if (isset($f->enum) && $f->enum && $f->type != 'boolean') {
                if ($value === '') {
                    $value = null;
                }
                if ($value !== null && !in_array($value, $f->enum, true)) {
                    throw new Exception([
                        'This is not one of the allowed values for the field',
                        'field' => $field,
                        'model' => $this,
                        'value' => $value,
                        'enum'  => $f->enum,
                    ]);
                }
            }

            // values property support
            if ($f->values) {
                if ($value === '') {
                    $value = null;
                } elseif ($value === null) {
                    // all is good
                } elseif (!is_string($value) && !is_int($value)) {
                    throw new Exception([
                        'Field can be only one of pre-defined value, so only "string" and "int" keys are supported',
                        'field' => $field,
                        'model' => $this,
                        'value' => $value,
                        'values'=> $f->values,
                    ]);
                } elseif (!array_key_exists($value, $f->values)) {
                    throw new Exception([
                        'This is not one of the allowed values for the field',
                        'field'   => $field,
                        'model'   => $this,
                        'value'   => $value,
                        'values'  => $f->values,
                    ]);
                }
            }
        }

        if (array_key_exists($field, $this->dirty) && (
            gettype($this->dirty[$field]) == gettype($value) && $this->dirty[$field] == $value
        )) {
            unset($this->dirty[$field]);
        } elseif (!array_key_exists($field, $this->dirty)) {
            $this->dirty[$field] =
                array_key_exists($field, $this->data) ?
                $this->data[$field] : $default_value;
        }
        $this->data[$field] = $value;

        return $this;
    }
1274422
public function setNewValue($field, $value)
    {
        $this->assertValidField($field);

        $this->documentChangeSet[$field][1] = $value;
    }
122258
public function selectBy($field, $value, $table = null)
	{
		if(null === $table)
		{
			$table = $this->tableName();
		}
		return $this->where(array((false === $table ? '' : ($table . '.')) . $field=>$value))->select();
	}
91640
public function set_select($field = '', $value = '', $default = false)
    {
        if (!$this->ran()) {
            return ($default === true) ? ' selected="selected"' : '';
        }

        $field = (isset($this->_field_data[$field]['postdata']) ? $this->_field_data[$field]['postdata']: '');
        $value = (string) $value;
        if (is_array($field)) {
        // Note: in_array('', array(0)) returns true, do not use it
            foreach ($field as $v) {
                if ($value === $v) {
                    return ' selected="selected"';
                }
            }

            return '';
        } elseif (($field === '' || $value === '') || ($field !== $value)) {
            return '';
        }

        return ' selected="selected"';
    }
914078
public function addField($field, $value=null) {
        $this->fields[] = $field;
        if ($value != null) $this->set($field, $value);
    }
981902
public function check($field, $value = null)
    {
        $element = $this->resolver->resolveForChecking($field, $value);

        if (! $element->isSelected()) {
            $element->click();
        }

        return $this;
    }