protected function setUp()
 {
     $this->schemaLinker = new SchemaLinker();
     $this->schemaLinker->setSchema(new BasicSchema());
     $this->object = new ChoiceTypeBuilder();
     $this->object->setSchemaLinker($this->schemaLinker);
     $this->schemaLinker->registerTypeBuilder($this->object);
 }
 protected function setUp()
 {
     $this->schema = new Schema();
     $this->schema->registerType('string', new StringType());
     $this->schemaLinker = new SchemaLinker();
     $this->schemaLinker->setSchema($this->schema);
     $this->classMap = new ClassMap();
     $this->implementation = new Implementation($this->classMap);
     $this->object = new ClassTypeBuilder();
     $this->object->setSchemaLinker($this->schemaLinker);
     $this->schemaLinker->registerTypeBuilder($this->object);
 }
 public function testLinkingProcessOnSchemaWithAlreadyDefinedTypes()
 {
     list($outline, $implementation) = $this->prepareLinker(false);
     /** @var SchemaOutline $outline */
     /** @var Implementation $implementation */
     $expectedSchema = new Schema();
     $expectedSchema->registerType('string', new StringType())->registerType('boolean', new FloatType())->registerType('binary', new BinaryType());
     $this->object->setSchema($expectedSchema);
     $result = $this->object->build($outline, $implementation);
     $this->assertEquals($expectedSchema, $result);
 }