Liip\RMT\Information\InformationRequest::getValue PHP Метод

getValue() публичный Метод

public getValue ( )
    public function getValue()
    {
        if (!$this->hasValue() && $this->options['default'] === null) {
            throw new \Liip\RMT\Exception("No value [{$this->name}] available");
        }
        return $this->hasValue() ? $this->value : $this->options['default'];
    }

Usage Example

 /**
  * @dataProvider getDataForValidationSuccess
  */
 public function testValidationSuccess($options, $value, $expected = null)
 {
     if (func_num_args() == 2) {
         $expected = $value;
     }
     $ir = new InformationRequest('foo', $options);
     $ir->setValue($value);
     $this->assertEquals($expected, $ir->getValue());
 }