public function testGetterSetter() { $sUT = new Schema(); $description = 'im'; $dollarSchema = 'a'; $id = 'test'; $required = 'very'; $title = 'super'; $type = 'efficient'; $sUT->setDescription($description); $sUT->setDollarSchema($dollarSchema); $sUT->setId($id); $sUT->addRequired($required); $sUT->setTitle($title); $sUT->setType($type); $this->assertEquals($description, $sUT->getDescription()); $this->assertEquals($dollarSchema, $sUT->getDollarSchema()); $this->assertEquals($id, $sUT->getId()); $this->assertEquals(array($required), $sUT->getRequired()); $this->assertEquals($title, $sUT->getTitle()); $this->assertEquals($type, $sUT->getType()); }
/** * basically set up the schema object with the properties * provided in the config * most items are defaulted as they are probably domain specific * * @throws InvalidConfigItemException */ protected function loadSchema() { if (!$this->validateSchemaConfigVariables()) { throw new InvalidConfigItemException("The provided config does not fill the Schema properly "); } // namespace is schema_ // try to set all the variables for the schema from the supplied config if (isset($this->config['schema_dollarSchema'])) { $this->schemaObject->setDollarSchema($this->config['schema_dollarSchema']); } if (isset($this->config['schema_required'])) { $this->schemaObject->setRequired($this->config['schema_required']); } if (isset($this->config['schema_title'])) { $this->schemaObject->setTitle($this->config['schema_title']); } if (isset($this->config['schema_description'])) { $this->schemaObject->setDescription($this->config['schema_description']); } if (isset($this->config['schema_type'])) { $this->schemaObject->setType($this->config['schema_type']); } return $this; }