示例#1
0
文件: Platform.php 项目: sigma-z/dive
 /**
  * gets data type
  *
  * @param  array $definition
  * @return string
  * @throws \LogicException
  */
 protected function getDataType(array $definition)
 {
     if (!isset($definition['type'])) {
         throw new \LogicException('Missing type in definition');
     }
     $length = isset($definition['length']) ? $definition['length'] : null;
     return $this->dataTypeMapper->getMappedDataType($definition['type'], $length);
 }
示例#2
0
 /**
  * @dataProvider provideGetMappedDataType
  */
 public function testGetMappedDataType($length, $ormType, $expected)
 {
     $actual = $this->dataTypeMapper->getMappedDataType($ormType, $length);
     $this->assertEquals($expected, $actual);
 }