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
da1d4c16
Unverified
Commit
da1d4c16
authored
Apr 20, 2017
by
James Titcumb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing filtering of table name assets in DB2SchemaManager
parent
eb487974
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
1 deletion
+69
-1
DB2SchemaManager.php
lib/Doctrine/DBAL/Schema/DB2SchemaManager.php
+3
-1
DB2SchemaManagerTest.php
tests/Doctrine/Tests/DBAL/Schema/DB2SchemaManagerTest.php
+66
-0
No files found.
lib/Doctrine/DBAL/Schema/DB2SchemaManager.php
View file @
da1d4c16
...
@@ -41,7 +41,9 @@ class DB2SchemaManager extends AbstractSchemaManager
...
@@ -41,7 +41,9 @@ class DB2SchemaManager extends AbstractSchemaManager
$tables
=
$this
->
_conn
->
fetchAll
(
$sql
);
$tables
=
$this
->
_conn
->
fetchAll
(
$sql
);
return
$this
->
_getPortableTablesList
(
$tables
);
$tableNames
=
$this
->
_getPortableTablesList
(
$tables
);
return
$this
->
filterAssetNames
(
$tableNames
);
}
}
/**
/**
...
...
tests/Doctrine/Tests/DBAL/Schema/DB2SchemaManagerTest.php
0 → 100644
View file @
da1d4c16
<?php
namespace
Doctrine\Tests\DBAL\Schema
;
use
Doctrine\Common\EventManager
;
use
Doctrine\DBAL\Configuration
;
use
Doctrine\DBAL\Connection
;
use
Doctrine\DBAL\Driver
;
use
Doctrine\DBAL\Platforms\DB2Platform
;
use
Doctrine\DBAL\Schema\DB2SchemaManager
;
/**
* @covers \Doctrine\DBAL\Schema\DB2SchemaManager
*/
final
class
DB2SchemaManagerTest
extends
\PHPUnit_Framework_TestCase
{
/**
* @var Connection
*/
private
$conn
;
/**
* @var DB2SchemaManager
*/
private
$manager
;
protected
function
setUp
()
{
$eventManager
=
new
EventManager
();
$driverMock
=
$this
->
getMock
(
Driver
::
class
);
$platform
=
$this
->
getMock
(
DB2Platform
::
class
);
$this
->
conn
=
$this
->
getMock
(
Connection
::
class
,
[
'fetchAll'
],
[[
'platform'
=>
$platform
],
$driverMock
,
new
Configuration
(),
$eventManager
]
);
$this
->
manager
=
new
DB2SchemaManager
(
$this
->
conn
);
}
public
function
testListTableNamesFiltersAssetNamesCorrectly
()
{
$this
->
conn
->
getConfiguration
()
->
setFilterSchemaAssetsExpression
(
'/^(?!T_)/'
);
$this
->
conn
->
expects
(
$this
->
once
())
->
method
(
'fetchAll'
)
->
will
(
$this
->
returnValue
([
[
'name'
=>
'FOO'
,
],
[
'name'
=>
'T_FOO'
,
],
[
'name'
=>
'BAR'
,
],
[
'name'
=>
'T_BAR'
,
],
]));
$this
->
assertSame
(
[
'FOO'
,
'BAR'
,
],
$this
->
manager
->
listTableNames
()
);
}
}
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