From b6583680a1baedcb0204c08d0dc43f9c26435151 Mon Sep 17 00:00:00 2001 From: zYne Date: Fri, 24 Nov 2006 16:06:12 +0000 Subject: [PATCH] added new datatype tests for sqlite --- tests/DataDict/SqliteTestCase.php | 43 ++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/tests/DataDict/SqliteTestCase.php b/tests/DataDict/SqliteTestCase.php index 791a01bbb..ef5e87797 100644 --- a/tests/DataDict/SqliteTestCase.php +++ b/tests/DataDict/SqliteTestCase.php @@ -1,3 +1,44 @@ dataDict->getDoctrineDeclaration(array('type' => $type, 'name' => 'colname', 'length' => 2, 'fixed' => true)); + } + public function testGetDoctrineDefinition() { + $this->assertEqual($this->getDeclaration('boolean'), array(array('boolean'), 1, false, null)); -?> + $this->assertEqual($this->getDeclaration('tinyint'), array(array('integer', 'boolean'), 1, false, null)); + $this->assertEqual($this->getDeclaration('smallint'), array(array('integer'), 2, false, null)); + $this->assertEqual($this->getDeclaration('mediumint'), array(array('integer'), 2, false, null)); + $this->assertEqual($this->getDeclaration('int'), array(array('integer'), 4, false, null)); + $this->assertEqual($this->getDeclaration('integer'), array(array('integer'), 4, false, null)); + $this->assertEqual($this->getDeclaration('serial'), array(array('integer'), 4, false, null)); + $this->assertEqual($this->getDeclaration('bigint'), array(array('integer'), 8, false, null)); + $this->assertEqual($this->getDeclaration('bigserial'), array(array('integer'), 8, false, null)); + /** + $this->assertEqual($this->getDeclaration('clob'), array(array('integer', 'boolean'), 1, false, null)); + $this->assertEqual($this->getDeclaration('tinytext'), array(array('integer'), 2, false, null)); + $this->assertEqual($this->getDeclaration('mediumtext'), array(array('integer'), 2, false, null)); + $this->assertEqual($this->getDeclaration('longtext'), array(array('integer'), 4, false, null)); + $this->assertEqual($this->getDeclaration('text'), array(array('integer'), 4, false, null)); + $this->assertEqual($this->getDeclaration('varchar'), array(array('integer'), 4, false, null)); + $this->assertEqual($this->getDeclaration('varchar2'), array(array('integer'), 8, false, null)); + + $this->assertEqual($this->getDeclaration('char'), array(array('integer'), 4, false, null)); + $this->assertEqual($this->getDeclaration('date'), array(array('integer'), 4, false, null)); + $this->assertEqual($this->getDeclaration('datetime'), array(array('integer'), 8, false, null)); + $this->assertEqual($this->getDeclaration('timestamp'), array(array('integer'), 8, false, null)); + $this->assertEqual($this->getDeclaration('time'), array(array('integer'), 8, false, null)); + */ + $this->assertEqual($this->getDeclaration('float'), array(array('float'), 8, false, null)); + $this->assertEqual($this->getDeclaration('double'), array(array('float'), 8, false, null)); + $this->assertEqual($this->getDeclaration('real'), array(array('float'), 8, false, null)); + + $this->assertEqual($this->getDeclaration('decimal'), array(array('decimal'), 8, false, null)); + $this->assertEqual($this->getDeclaration('numeric'), array(array('decimal'), 8, false, null)); + + $this->assertEqual($this->getDeclaration('tinyblob'), array(array('blob'), 8, false, null)); + $this->assertEqual($this->getDeclaration('mediumblob'), array(array('blob'), 8, false, null)); + $this->assertEqual($this->getDeclaration('longblob'), array(array('blob'), 8, false, null)); + $this->assertEqual($this->getDeclaration('blob'), array(array('blob'), 8, false, null)); + } +}