Exemple #1
0
 public function testString()
 {
     $this->object->set('A string');
     $this->assertEquals('A string', $this->object->value());
     $this->object->set('Another string');
     $this->assertEquals('Another string', $this->object->value());
 }
Exemple #2
0
 /**
  * Set value
  * @param mixed $value new value
  * @throws \InvalidArgumentException
  */
 public function set($value)
 {
     if ($this->valueIsAllowed($value)) {
         parent::set($value);
     } else {
         throw new \InvalidArgumentException('Invalid option ("' . $value . '") for select value.');
     }
 }