/** * @depends testRegisterTypeBuilder */ public function testGeneratorsPriority() { $implementation = $this->getImplementationMock(); $specialBuilder = new MapToSpecialTypesBuilder(); $specialBuilder->mapToSpecialType('string', 'Wookieb\\ZorroDataSchema\\Schema\\Type\\BooleanType'); $this->object->registerTypeBuilder(new BasicTypesBuilder())->registerTypeBuilder($specialBuilder, 100); $this->assertInstanceOf('Wookieb\\ZorroDataSchema\\Schema\\Type\\FloatType', $this->object->generateType(new FloatOutline(), $implementation)); $this->assertInstanceOf('Wookieb\\ZorroDataSchema\\Schema\\Type\\BooleanType', $this->object->generateType(new StringOutline(), $implementation)); }
public function testExceptionWhenThereIsNoMappedTypeForOutline() { $msg = 'There is no mapped type class for type "string"'; $this->setExpectedException('Wookieb\\ZorroDataSchema\\Exception\\UnableToGenerateTypeException', $msg); $this->object->generate(new StringOutline(), $this->getImplementationMock()); }