Commit 574fabd4 authored by Claudio Zizza's avatar Claudio Zizza

unittest for fixed string alteration added

parent 17fdd830
...@@ -755,4 +755,32 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa ...@@ -755,4 +755,32 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa
{ {
return 'INDEX "select" (foo)'; 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