Commit 3149a9fd authored by Marco Pivetta's avatar Marco Pivetta

Merge branch 'hotfix/#696-DBAL-1013-table-diff-new-name-may-not-be-set'

Close #696
parents b7730eee fadc5d81
......@@ -155,10 +155,10 @@ class TableDiff
}
/**
* @return \Doctrine\DBAL\Schema\Identifier
* @return \Doctrine\DBAL\Schema\Identifier|boolean
*/
public function getNewName()
{
return new Identifier($this->newName);
return $this->newName ? new Identifier($this->newName) : $this->newName;
}
}
<?php
namespace Doctrine\Tests\DBAL\Schema;
use Doctrine\DBAL\Schema\Identifier;
use Doctrine\DBAL\Schema\TableDiff;
class TableDiffTest extends \PHPUnit_Framework_TestCase
{
/**
* @group DBAL-1013
*/
public function testReturnsName()
{
$tableDiff = new TableDiff('foo');
$this->assertEquals(new Identifier('foo'), $tableDiff->getName());
}
/**
* @group DBAL-1013
*/
public function testReturnsNewName()
{
$tableDiff = new TableDiff('foo');
$this->assertFalse($tableDiff->getNewName());
$tableDiff->newName = 'bar';
$this->assertEquals(new Identifier('bar'), $tableDiff->getNewName());
}
}
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