public function testGeneratesColumnTypesDeclarationSQL() { $fullColumnDef = array('length' => 10, 'fixed' => true, 'unsigned' => true, 'autoincrement' => true); $this->assertEquals('VARCHAR(255)', $this->_platform->getVarcharTypeDeclarationSQL(array())); $this->assertEquals('VARCHAR(10)', $this->_platform->getVarcharTypeDeclarationSQL(array('length' => 10))); $this->assertEquals('CHAR(255)', $this->_platform->getVarcharTypeDeclarationSQL(array('fixed' => true))); $this->assertEquals('CHAR(10)', $this->_platform->getVarcharTypeDeclarationSQL($fullColumnDef)); $this->assertEquals('SMALLINT', $this->_platform->getSmallIntTypeDeclarationSQL(array())); $this->assertEquals('SMALLINT', $this->_platform->getSmallIntTypeDeclarationSQL(array('unsigned' => true))); $this->assertEquals('SMALLINT GENERATED BY DEFAULT AS IDENTITY', $this->_platform->getSmallIntTypeDeclarationSQL($fullColumnDef)); $this->assertEquals('INTEGER', $this->_platform->getIntegerTypeDeclarationSQL(array())); $this->assertEquals('INTEGER', $this->_platform->getIntegerTypeDeclarationSQL(array('unsigned' => true))); $this->assertEquals('INTEGER GENERATED BY DEFAULT AS IDENTITY', $this->_platform->getIntegerTypeDeclarationSQL($fullColumnDef)); $this->assertEquals('BIGINT', $this->_platform->getBigIntTypeDeclarationSQL(array())); $this->assertEquals('BIGINT', $this->_platform->getBigIntTypeDeclarationSQL(array('unsigned' => true))); $this->assertEquals('BIGINT GENERATED BY DEFAULT AS IDENTITY', $this->_platform->getBigIntTypeDeclarationSQL($fullColumnDef)); $this->assertEquals('BLOB(1M)', $this->_platform->getBlobTypeDeclarationSQL($fullColumnDef)); $this->assertEquals('SMALLINT', $this->_platform->getBooleanTypeDeclarationSQL($fullColumnDef)); $this->assertEquals('CLOB(1M)', $this->_platform->getClobTypeDeclarationSQL($fullColumnDef)); $this->assertEquals('DATE', $this->_platform->getDateTypeDeclarationSQL($fullColumnDef)); $this->assertEquals('TIMESTAMP(0) WITH DEFAULT', $this->_platform->getDateTimeTypeDeclarationSQL(array('version' => true))); $this->assertEquals('TIMESTAMP(0)', $this->_platform->getDateTimeTypeDeclarationSQL($fullColumnDef)); $this->assertEquals('TIME', $this->_platform->getTimeTypeDeclarationSQL($fullColumnDef)); }