Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
52eabb4f
Commit
52eabb4f
authored
Oct 17, 2014
by
Steve Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix table diff's new name if it is not set
parent
1b210ad8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 deletions
+35
-2
TableDiff.php
lib/Doctrine/DBAL/Schema/TableDiff.php
+2
-2
TableDiffTest.php
tests/Doctrine/Tests/DBAL/Schema/TableDiffTest.php
+33
-0
No files found.
lib/Doctrine/DBAL/Schema/TableDiff.php
View file @
52eabb4f
...
...
@@ -155,10 +155,10 @@ class TableDiff
}
/**
* @return \Doctrine\DBAL\Schema\Identifier
* @return \Doctrine\DBAL\Schema\Identifier
|false
*/
public
function
getNewName
()
{
return
new
Identifier
(
$this
->
newName
)
;
return
$this
->
newName
?
new
Identifier
(
$this
->
newName
)
:
$this
->
newName
;
}
}
tests/Doctrine/Tests/DBAL/Schema/TableDiffTest.php
0 → 100644
View file @
52eabb4f
<?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
());
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment