public function testSerialize() { $property = new Property('id', Property::TYPE_INTEGER, 'Foobar'); $property->setFormat(Property::FORMAT_INT64); $property->setDefaultValue(12); $property->setEnum(array(12, 24, 48)); $property->setMinimum(8); $property->setMaximum(20); $content = <<<JSON { "id": "id", "type": "integer", "format": "int64", "description": "Foobar", "defaultValue": 12, "enum": [12, 24, 48], "minimum": 8, "maximum": 20 } JSON; $this->assertRecordEqualsContent($property, $content); }
public function addProperty(Property $property) { $this->properties->{$property->getId()} = $property; }