Liip\RMT\Information\InformationRequest::setValue PHP Method

setValue() public method

public setValue ( $value )
    public function setValue($value)
    {
        try {
            $value = $this->validate($value);
        } catch (\Exception $e) {
            throw new \InvalidArgumentException('Validation error for [' . $this->getName() . ']: ' . $e->getMessage());
        }
        $this->value = $value;
        $this->hasValue = true;
    }

Usage Example

 /**
  * @dataProvider getDataForValidationFail
  * @expectedException \InvalidArgumentException
  */
 public function testValidationFail($options, $value)
 {
     $ir = new InformationRequest('foo', $options);
     $ir->setValue($value);
 }