public function testBuildWithProvidedSchema()
 {
     $outline = new SchemaOutline();
     $outline->addTypeOutline(new StringOutline());
     $this->object->setSchemaOutlineBuilder(new SchemaOutlineBuilder($outline));
     $expected = new Schema();
     $expected->registerType('string', new StringType());
     $this->prepareBuilder($expected);
     $this->assertEquals($expected, $this->object->build());
 }
Пример #2
0
 /**
  * @depends testRegisterType
  */
 public function testIteration()
 {
     $this->assertSame(0, $this->object->getIterator()->count());
     $this->object->registerType('VibrantAcknowledgment', $this->type);
     $this->assertSame(1, $this->object->getIterator()->count());
 }
 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);
 }