コード例 #1
0
 public function testToArray()
 {
     $sUT = new Schema();
     $sUT->addProperty('test', new Property());
     $sUT->addItem('test', new Item());
     $this->assertInternalType('array', $sUT->toArray());
 }
コード例 #2
0
 /**
  * @param string $key
  * @param JSONSchema\Structure\Item $item
  * @return $this
  */
 protected function appendItem($key, Item $item)
 {
     if (!isset($this->schemaObject)) {
         throw new NoStructureFoundException("The Schema is not attached or is not initialized. ");
     }
     $this->schemaObject->addItem($key, $item);
     return $this;
 }