コード例 #1
0
ファイル: SwizzleTest.php プロジェクト: rodsouto/swizzle
 /**
  * Test a property can inherit an existing model by reference
  * @depends testServiceConstruct
  */
 public function testModelResolvesReference(Swizzle $builder)
 {
     $child = array('id' => 'barType', 'type' => 'object');
     $parent = array('id' => 'bazType', 'type' => 'object', 'properties' => array('bar' => array('$ref' => 'barType')));
     $builder->addModel($child);
     $builder->addModel($parent);
     $descr = $builder->getServiceDescription();
     $baz = $descr->getModel('bazType');
     $this->assertEquals('object', $baz->getProperty('bar')->getType());
 }