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
f471a0fd
Commit
f471a0fd
authored
Jan 11, 2016
by
Kim Hemsø Rasmussen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for all variants
parent
d7bbd303
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
5 deletions
+23
-5
DriverTest.php
...rine/Tests/DBAL/Functional/Driver/PDOPgSql/DriverTest.php
+23
-5
No files found.
tests/Doctrine/Tests/DBAL/Functional/Driver/PDOPgSql/DriverTest.php
View file @
f471a0fd
...
@@ -5,6 +5,7 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\PDOPgSql;
...
@@ -5,6 +5,7 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\PDOPgSql;
use
Doctrine\DBAL\Connection
;
use
Doctrine\DBAL\Connection
;
use
Doctrine\DBAL\Driver\PDOPgSql\Driver
;
use
Doctrine\DBAL\Driver\PDOPgSql\Driver
;
use
Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest
;
use
Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest
;
use
Doctrine\Tests\TestUtil
;
class
DriverTest
extends
AbstractDriverTest
class
DriverTest
extends
AbstractDriverTest
{
{
...
@@ -21,12 +22,14 @@ class DriverTest extends AbstractDriverTest
...
@@ -21,12 +22,14 @@ class DriverTest extends AbstractDriverTest
}
}
}
}
public
function
testDefaultDatabaseOption
()
/**
@dataProvider getDatabaseParameter
*/
public
function
testDatabaseParameters
(
$databaseName
,
$defaultDatabaseName
,
$expectedDatabaseName
)
{
{
$params
=
$this
->
_conn
->
getParams
();
$params
=
$this
->
_conn
->
getParams
();
$dbName
=
$params
[
'dbname'
];
$params
[
'dbname'
]
=
$databaseName
;
$params
[
'default_dbname'
]
=
$dbName
;
$params
[
'default_dbname'
]
=
$defaultDatabaseName
;
unset
(
$params
[
'dbname'
]);
$connection
=
new
Connection
(
$connection
=
new
Connection
(
$params
,
$params
,
...
@@ -36,11 +39,26 @@ class DriverTest extends AbstractDriverTest
...
@@ -36,11 +39,26 @@ class DriverTest extends AbstractDriverTest
);
);
$this
->
assertSame
(
$this
->
assertSame
(
$
db
Name
,
$
expectedDatabase
Name
,
$this
->
driver
->
getDatabase
(
$connection
)
$this
->
driver
->
getDatabase
(
$connection
)
);
);
}
}
public
function
getDatabaseParameter
()
{
$params
=
TestUtil
::
getConnection
()
->
getParams
();
$realDatabaseName
=
$params
[
'dbname'
];
$dummyDatabaseName
=
$realDatabaseName
.
'a'
;
return
array
(
// dbname, default_dbname, expected
array
(
$realDatabaseName
,
null
,
$realDatabaseName
),
array
(
$realDatabaseName
,
$dummyDatabaseName
,
$realDatabaseName
),
array
(
null
,
$realDatabaseName
,
$realDatabaseName
),
array
(
null
,
null
,
$this
->
getDatabaseNameForConnectionWithoutDatabaseNameParameter
()),
);
}
/**
/**
* @group DBAL-1146
* @group DBAL-1146
*/
*/
...
...
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