1
0
mirror of synced 2024-12-13 22:56:04 +03:00
doctrine2/tests/DataDict/PgsqlTestCase.php
2006-11-24 23:23:21 +00:00

32 lines
1.7 KiB
PHP

<?php
class Doctrine_DataDict_Pgsql_TestCase extends Doctrine_Driver_UnitTestCase {
public function __construct() {
parent::__construct('pgsql');
}
public function getDeclaration($type) {
return $this->dataDict->getDoctrineDeclaration(array('type' => $type, 'name' => 'colname', 'length' => 2, 'fixed' => true));
}
public function testGetDoctrineDefinition() {
$this->assertEqual($this->getDeclaration('smallint'), array(array('integer', 'boolean'), 2, false, null));
$this->assertEqual($this->getDeclaration('int2'), array(array('integer', 'boolean'), 2, false, null));
$this->assertEqual($this->getDeclaration('int'), array(array('integer'), 4, false, null));
$this->assertEqual($this->getDeclaration('int4'), 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('serial4'), array(array('integer'), 4, false, null));
$this->assertEqual($this->getDeclaration('bigint'), array(array('integer'), 8, false, null));
$this->assertEqual($this->getDeclaration('int8'), array(array('integer'), 8, false, null));
$this->assertEqual($this->getDeclaration('bigserial'), array(array('integer'), 8, false, null));
$this->assertEqual($this->getDeclaration('serial8'), array(array('integer'), 8, false, null));
$this->assertEqual($this->getDeclaration('bool'), array(array('boolean'), 1, false, null));
$this->assertEqual($this->getDeclaration('boolean'), array(array('boolean'), 1, false, null));
}
}