Commit d9a12aab authored by Claudio Zizza's avatar Claudio Zizza Committed by Steve Müller

unittest for fixed string alteration added

parent 439200b6
......@@ -755,4 +755,32 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa
{
return 'INDEX "select" (foo)';
}
/**
* @todo add issue ticket number as phpunit group
*/
public function testAlterStringToFixedString()
{
$table = new Table('mytable');
$table->addColumn('name', 'string', array('length' => 2));
$tableDiff = new TableDiff('mytable');
$tableDiff->fromTable = $table;
$tableDiff->changedColumns['dloo1'] = new \Doctrine\DBAL\Schema\ColumnDiff(
'name', new \Doctrine\DBAL\Schema\Column(
'name', \Doctrine\DBAL\Types\Type::getType('string'), array('fixed' => true, 'length' => 2)
),
array('fixed')
);
$sql = $this->_platform->getAlterTableSQL($tableDiff);
$expectedSql = array(
'ALTER TABLE mytable ALTER name TYPE CHAR(2)',
);
$this->assertEquals($expectedSql, $sql);
}
}
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