public function get($property_name) { if (!is_string($property_name)) { throw new \InvalidArgumentException('Invalid parameter given!'); } elseif (array_key_exists($property_name, get_object_vars($this))) { return $this->{$property_name}; } else { throw new \OutOfRangeException("Requested property does not exist!"); } }
/** * @Test */ public function testTogglers() { $this->segment->disable(); $this->assertEquals(true, $this->segment->get('disabled')); $this->segment->enable(); $this->assertEquals(false, $this->segment->get('disabled')); }