Commit 0c82cfb0 authored by zYne's avatar zYne

--no commit message

--no commit message
parent a4167f8d
...@@ -45,71 +45,113 @@ class Doctrine_DataDict_Mssql_TestCase extends Doctrine_UnitTestCase ...@@ -45,71 +45,113 @@ class Doctrine_DataDict_Mssql_TestCase extends Doctrine_UnitTestCase
{ {
$type = $this->dataDict->getPortableDeclaration(array('type' => 'bit')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'bit'));
$this->assertEqual($type, array(array('boolean'), null, null, null)); $this->assertEqual($type, array('type' => array('boolean'),
'length' => null,
'unsigned' => null,
'fixed' => null));
} }
public function testGetPortableDeclarationSupportsNativeStringTypes() public function testGetPortableDeclarationSupportsNativeStringTypes()
{ {
$type = $this->dataDict->getPortableDeclaration(array('type' => 'text')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'text'));
$this->assertEqual($type, array(array('string', 'clob'), null, null, null)); $this->assertEqual($type, array('type' => array('string', 'clob'),
'length' => null,
'unsigned' => null,
'fixed' => null));
$type = $this->dataDict->getPortableDeclaration(array('type' => 'char', 'length' => 1)); $type = $this->dataDict->getPortableDeclaration(array('type' => 'char', 'length' => 1));
$this->assertEqual($type, array(array('string', 'boolean'), 1, null, true)); $this->assertEqual($type, array('type' => array('string', 'boolean'),
'length' => 1,
'unsigned' => null,
'fixed' => true));
$type = $this->dataDict->getPortableDeclaration(array('type' => 'varchar', 'length' => 1)); $type = $this->dataDict->getPortableDeclaration(array('type' => 'varchar', 'length' => 1));
$this->assertEqual($type, array(array('string', 'boolean'), 1, null, false)); $this->assertEqual($type, array('type' => array('string', 'boolean'),
'length' => 1,
'unsigned' => null,
'fixed' => false));
} }
public function testGetPortableDeclarationSupportsNativeBlobTypes() public function testGetPortableDeclarationSupportsNativeBlobTypes()
{ {
$type = $this->dataDict->getPortableDeclaration(array('type' => 'image')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'image'));
$this->assertEqual($type, array(array('blob'), null, null, null)); $this->assertEqual($type, array('type' => array('blob'),
'length' => null,
'unsigned' => null,
'fixed' => null));
$type = $this->dataDict->getPortableDeclaration(array('type' => 'varbinary')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'varbinary'));
$this->assertEqual($type, array(array('blob'), null, null, null)); $this->assertEqual($type, array('type' => array('blob'),
'length' => null,
'unsigned' => null,
'fixed' => null));
} }
public function testGetPortableDeclarationSupportsNativeIntegerTypes() public function testGetPortableDeclarationSupportsNativeIntegerTypes()
{ {
$type = $this->dataDict->getPortableDeclaration(array('type' => 'int')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'int'));
$this->assertEqual($type, array(array('integer'), null, null, null)); $this->assertEqual($type, array('type' => array('integer'),
'length' => null,
'unsigned' => null,
'fixed' => null));
$type = $this->dataDict->getPortableDeclaration(array('type' => 'int', 'length' => 1)); $type = $this->dataDict->getPortableDeclaration(array('type' => 'int', 'length' => 1));
$this->assertEqual($type, array(array('integer', 'boolean'), 1, null, null)); $this->assertEqual($type, array('type' => array('integer', 'boolean'),
'length' => 1,
'unsigned' => null,
'fixed' => null));
} }
public function testGetPortableDeclarationSupportsNativeTimestampType() public function testGetPortableDeclarationSupportsNativeTimestampType()
{ {
$type = $this->dataDict->getPortableDeclaration(array('type' => 'datetime')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'datetime'));
$this->assertEqual($type, array(array('timestamp'), null, null, null)); $this->assertEqual($type, array('type' => array('timestamp'),
'length' => null,
'unsigned' => null,
'fixed' => null));
} }
public function testGetPortableDeclarationSupportsNativeDecimalTypes() public function testGetPortableDeclarationSupportsNativeDecimalTypes()
{ {
$type = $this->dataDict->getPortableDeclaration(array('type' => 'decimal')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'decimal'));
$this->assertEqual($type, array(array('decimal'), null, null, null)); $this->assertEqual($type, array('type' => array('decimal'),
'length' => null,
'unsigned' => null,
'fixed' => null));
$type = $this->dataDict->getPortableDeclaration(array('type' => 'money')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'money'));
$this->assertEqual($type, array(array('decimal'), null, null, null)); $this->assertEqual($type, array('type' => array('decimal'),
'length' => null,
'unsigned' => null,
'fixed' => null));
} }
public function testGetPortableDeclarationSupportsNativeFloatTypes() public function testGetPortableDeclarationSupportsNativeFloatTypes()
{ {
$type = $this->dataDict->getPortableDeclaration(array('type' => 'float')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'float'));
$this->assertEqual($type, array(array('float'), null, null, null)); $this->assertEqual($type, array('type' => array('float'),
'length' => null,
'unsigned' => null,
'fixed' => null));
$type = $this->dataDict->getPortableDeclaration(array('type' => 'real')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'real'));
$this->assertEqual($type, array(array('float'), null, null, null)); $this->assertEqual($type, array('type' => array('float'),
'length' => null,
'unsigned' => null,
'fixed' => null));
$type = $this->dataDict->getPortableDeclaration(array('type' => 'numeric')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'numeric'));
$this->assertEqual($type, array(array('float'), null, null, null)); $this->assertEqual($type, array('type' => array('float'),
'length' => null,
'unsigned' => null,
'fixed' => null));
} }
public function testGetNativeDefinitionSupportsIntegerType() public function testGetNativeDefinitionSupportsIntegerType()
{ {
......
...@@ -44,96 +44,158 @@ class Doctrine_DataDict_Oracle_TestCase extends Doctrine_UnitTestCase { ...@@ -44,96 +44,158 @@ class Doctrine_DataDict_Oracle_TestCase extends Doctrine_UnitTestCase {
{ {
$type = $this->dataDict->getPortableDeclaration(array('type' => 'float')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'float'));
$this->assertEqual($type, array(array('float'), null, null, null)); $this->assertEqual($type, array('type' => array('float'),
'length' => null,
'unsigned' => null,
'fixed' => null));
} }
public function testGetPortableDeclarationSupportsNativeIntegerTypes() public function testGetPortableDeclarationSupportsNativeIntegerTypes()
{ {
$type = $this->dataDict->getPortableDeclaration(array('type' => 'integer')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'integer'));
$this->assertEqual($type, array(array('integer'), null, null, null)); $this->assertEqual($type, array('type' => array('integer'),
'length' => null,
'unsigned' => null,
'fixed' => null));
$type = $this->dataDict->getPortableDeclaration(array('type' => 'pls_integer', 'length' => 1)); $type = $this->dataDict->getPortableDeclaration(array('type' => 'pls_integer', 'length' => 1));
$this->assertEqual($type, array(array('integer', 'boolean'), 1, null, null)); $this->assertEqual($type, array('type' => array('integer', 'boolean'),
'length' => 1,
'unsigned' => null,
'fixed' => null));
$type = $this->dataDict->getPortableDeclaration(array('type' => 'binary_integer', 'length' => 1)); $type = $this->dataDict->getPortableDeclaration(array('type' => 'binary_integer', 'length' => 1));
$this->assertEqual($type, array(array('integer', 'boolean'), 1, null, null)); $this->assertEqual($type, array('type' => array('integer', 'boolean'),
'length' => 1,
'unsigned' => null,
'fixed' => null));
} }
public function testGetPortableDeclarationSupportsNativeStringTypes() public function testGetPortableDeclarationSupportsNativeStringTypes()
{ {
$type = $this->dataDict->getPortableDeclaration(array('type' => 'varchar')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'varchar'));
$this->assertEqual($type, array(array('string'), null, null, null)); $this->assertEqual($type, array('type' => array('string'),
'length' => null,
'unsigned' => null,
'fixed' => null));
$type = $this->dataDict->getPortableDeclaration(array('type' => 'varchar2', 'length' => 1)); $type = $this->dataDict->getPortableDeclaration(array('type' => 'varchar2', 'length' => 1));
$this->assertEqual($type, array(array('string', 'boolean'), 1, null, false)); $this->assertEqual($type, array('type' => array('string', 'boolean'),
'length' => 1,
'unsigned' => null,
'fixed' => false));
$type = $this->dataDict->getPortableDeclaration(array('type' => 'nvarchar2', 'length' => 1)); $type = $this->dataDict->getPortableDeclaration(array('type' => 'nvarchar2', 'length' => 1));
$this->assertEqual($type, array(array('string', 'boolean'), 1, null, false)); $this->assertEqual($type, array('type' => array('string', 'boolean'),
'length' => 1,
'unsigned' => null,
'fixed' => false));
$type = $this->dataDict->getPortableDeclaration(array('type' => 'char', 'length' => 1)); $type = $this->dataDict->getPortableDeclaration(array('type' => 'char', 'length' => 1));
$this->assertEqual($type, array(array('string', 'boolean'), 1, null, true)); $this->assertEqual($type, array('type' => array('string', 'boolean'),
'length' => 1,
'unsigned' => null,
'fixed' => true));
$type = $this->dataDict->getPortableDeclaration(array('type' => 'nchar', 'length' => 1)); $type = $this->dataDict->getPortableDeclaration(array('type' => 'nchar', 'length' => 1));
$this->assertEqual($type, array(array('string', 'boolean'), 1, null, true)); $this->assertEqual($type, array('type' => array('string', 'boolean'),
'length' => 1,
'unsigned' => null,
'fixed' => true));
} }
public function testGetPortableDeclarationSupportsNativeNumberType() public function testGetPortableDeclarationSupportsNativeNumberType()
{ {
$type = $this->dataDict->getPortableDeclaration(array('type' => 'number')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'number'));
$this->assertEqual($type, array(array('integer'), null, null, null)); $this->assertEqual($type, array('type' => array('integer'),
'length' => null,
'unsigned' => null,
'fixed' => null));
$type = $this->dataDict->getPortableDeclaration(array('type' => 'number', 'length' => 1)); $type = $this->dataDict->getPortableDeclaration(array('type' => 'number', 'length' => 1));
$this->assertEqual($type, array(array('integer', 'boolean'), 1, null, null)); $this->assertEqual($type, array('type' => array('integer', 'boolean'),
'length' => 1,
'unsigned' => null,
'fixed' => null));
} }
public function testGetPortableDeclarationSupportsNativeTimestampType() public function testGetPortableDeclarationSupportsNativeTimestampType()
{ {
$type = $this->dataDict->getPortableDeclaration(array('type' => 'date')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'date'));
$this->assertEqual($type, array(array('timestamp'), null, null, null)); $this->assertEqual($type, array('type' => array('timestamp'),
'length' => null,
'unsigned' => null,
'fixed' => null));
$type = $this->dataDict->getPortableDeclaration(array('type' => 'timestamp')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'timestamp'));
$this->assertEqual($type, array(array('timestamp'), null, null, null)); $this->assertEqual($type, array('type' => array('timestamp'),
'length' => null,
'unsigned' => null,
'fixed' => null));
} }
public function testGetPortableDeclarationSupportsNativeClobTypes() public function testGetPortableDeclarationSupportsNativeClobTypes()
{ {
$type = $this->dataDict->getPortableDeclaration(array('type' => 'clob')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'clob'));
$this->assertEqual($type, array(array('clob'), null, null, null)); $this->assertEqual($type, array('type' => array('clob'),
'length' => null,
'unsigned' => null,
'fixed' => null));
$type = $this->dataDict->getPortableDeclaration(array('type' => 'long')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'long'));
$this->assertEqual($type, array(array('string', 'clob'), null, null, null)); $this->assertEqual($type, array('type' => array('string', 'clob'),
'length' => null,
'unsigned' => null,
'fixed' => null));
$type = $this->dataDict->getPortableDeclaration(array('type' => 'nclob')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'nclob'));
$this->assertEqual($type, array(array('clob'), null, null, null)); $this->assertEqual($type, array('type' => array('clob'),
'length' => null,
'unsigned' => null,
'fixed' => null));
} }
public function testGetPortableDeclarationSupportsNativeBlobTypes() public function testGetPortableDeclarationSupportsNativeBlobTypes()
{ {
$type = $this->dataDict->getPortableDeclaration(array('type' => 'blob')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'blob'));
$this->assertEqual($type, array(array('blob'), null, null, null)); $this->assertEqual($type, array('type' => array('blob'),
'length' => null,
'unsigned' => null,
'fixed' => null));
$type = $this->dataDict->getPortableDeclaration(array('type' => 'long raw')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'long raw'));
$this->assertEqual($type, array(array('blob'), null, null, null)); $this->assertEqual($type, array('type' => array('blob'),
'length' => null,
'unsigned' => null,
'fixed' => null));
$type = $this->dataDict->getPortableDeclaration(array('type' => 'long raw')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'long raw'));
$this->assertEqual($type, array(array('blob'), null, null, null)); $this->assertEqual($type, array('type' => array('blob'),
'length' => null,
'unsigned' => null,
'fixed' => null));
$type = $this->dataDict->getPortableDeclaration(array('type' => 'raw')); $type = $this->dataDict->getPortableDeclaration(array('type' => 'raw'));
$this->assertEqual($type, array(array('blob'), null, null, null)); $this->assertEqual($type, array('type' => array('blob'),
'length' => null,
'unsigned' => null,
'fixed' => null));
} }
public function testGetNativeDefinitionSupportsIntegerType() public function testGetNativeDefinitionSupportsIntegerType()
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment