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
 public function testExceptionWhenTypeNotExist()
 {
     $msg = 'Type "VibrantAcknowledgment" does not exist';
     $this->setExpectedException('Wookieb\\ZorroDataSchema\\Exception\\TypeNotFoundException', $msg);
     $this->object->getType('VibrantAcknowledgment');
 }
 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);
 }