public function testtoObject() { $sUT = new Item(); $sUT->addProperty('test', new Property()); $sUT->addRequired('test'); $this->assertInstanceOf('stdClass', $sUT->toObject()); }
/** * @param mixed $property * @param Item $item * @return Item */ private function determineChildItem($property, Item $item, Schema $schema) { if (PropertyTypeMapper::map($property) === PropertyTypeMapper::OBJECT_TYPE) { foreach (get_object_vars($property) as $key => $itemzz) { $item->addProperty($key, $this->determineProperty($itemzz, $key, $schema), $schema->getConfig()->isRequiredDefault()); } } return $item; }