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
6c200e7a
Commit
6c200e7a
authored
Jan 09, 2016
by
Steve Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cover an additional case of avoiding multi drop foreign key avoid in tests
parent
b2a345f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
+21
-10
ComparatorTest.php
tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php
+21
-10
No files found.
tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php
View file @
6c200e7a
...
...
@@ -978,22 +978,33 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
{
$oldSchema
=
new
Schema
();
$tableForeign
=
$oldSchema
->
createTable
(
'foreign'
);
$tableForeign
->
addColumn
(
'id'
,
'integer'
);
$tableA
=
$oldSchema
->
createTable
(
'table_a'
);
$tableA
->
addColumn
(
'id'
,
'integer'
);
$tableB
=
$oldSchema
->
createTable
(
'table_b'
);
$tableB
->
addColumn
(
'id'
,
'integer'
);
$table
=
$oldSchema
->
createTable
(
'foo'
);
$table
->
addColumn
(
'fk'
,
'integer'
);
$table
->
addForeignKeyConstraint
(
$tableForeign
,
array
(
'fk'
),
array
(
'id'
));
$tableC
=
$oldSchema
->
createTable
(
'table_c'
);
$tableC
->
addColumn
(
'id'
,
'integer'
);
$tableC
->
addColumn
(
'table_a_id'
,
'integer'
);
$tableC
->
addColumn
(
'table_b_id'
,
'integer'
);
$tableC
->
addForeignKeyConstraint
(
$tableA
,
array
(
'table_a_id'
),
array
(
'id'
));
$tableC
->
addForeignKeyConstraint
(
$tableB
,
array
(
'table_b_id'
),
array
(
'id'
));
$newSchema
=
new
Schema
();
$table
=
$newSchema
->
createTable
(
'foo'
);
$c
=
new
Comparator
();
$diff
=
$c
->
compare
(
$oldSchema
,
$newSchema
);
$tableB
=
$newSchema
->
createTable
(
'table_b'
);
$tableB
->
addColumn
(
'id'
,
'integer'
);
$tableC
=
$newSchema
->
createTable
(
'table_c'
);
$tableC
->
addColumn
(
'id'
,
'integer'
);
$comparator
=
new
Comparator
();
$schemaDiff
=
$comparator
->
compare
(
$oldSchema
,
$newSchema
);
$this
->
assertCount
(
0
,
$diff
->
changedTables
[
'foo
'
]
->
removedForeignKeys
);
$this
->
assertCount
(
1
,
$
d
iff
->
orphanedForeignKeys
);
$this
->
assertCount
(
1
,
$schemaDiff
->
changedTables
[
'table_c
'
]
->
removedForeignKeys
);
$this
->
assertCount
(
1
,
$
schemaD
iff
->
orphanedForeignKeys
);
}
public
function
testCompareChangedColumn
()
...
...
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