public function getValue() { if (null === $this->value) { throw new \LogicException('Value is not set for variable "' . $this->name . '"'); } return $this->value; }
/** * @expectedException \LogicException * @expectedExceptionMessage Value is not set for variable "foo" */ public function testGetNullValueException() { $var = new Variable('foo', 'bar', false, false, new Location(1, 1)); $var->getValue(); }