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
18507520
Commit
18507520
authored
Apr 30, 2015
by
Steve Müller
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #829 from zeroedin-bill/pgsql-connection-test
Pgsql connection test with charset parameter
parents
c8c5470e
63f18951
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
PDOPgsqlConnectionTest.php
...e/Tests/DBAL/Functional/Driver/PDOPgsqlConnectionTest.php
+56
-0
No files found.
tests/Doctrine/Tests/DBAL/Functional/Driver/PDOPgsqlConnectionTest.php
0 → 100644
View file @
18507520
<?php
namespace
Doctrine\Tests\DBAL\Functional\Driver
;
use
Doctrine\DBAL\DriverManager
;
use
Doctrine\DBAL\Platforms\PostgreSqlPlatform
;
use
Doctrine\Tests\DbalFunctionalTestCase
;
class
PDOPgsqlConnectionTest
extends
DbalFunctionalTestCase
{
protected
function
setUp
()
{
if
(
!
extension_loaded
(
'pdo_pgsql'
))
{
$this
->
markTestSkipped
(
'pdo_pgsql is not loaded.'
);
}
parent
::
setUp
();
if
(
!
$this
->
_conn
->
getDatabasePlatform
()
instanceof
PostgreSqlPlatform
)
{
$this
->
markTestSkipped
(
'PDOPgsql only test.'
);
}
}
/**
* @group DBAL-1183
* @group DBAL-1189
*
* @dataProvider getValidCharsets
*
* @param string $charset
*/
public
function
testConnectsWithValidCharsetOption
(
$charset
)
{
$params
=
$this
->
_conn
->
getParams
();
$params
[
'charset'
]
=
$charset
;
$connection
=
DriverManager
::
getConnection
(
$params
,
$this
->
_conn
->
getConfiguration
(),
$this
->
_conn
->
getEventManager
()
);
$this
->
assertEquals
(
$charset
,
$connection
->
query
(
"SHOW client_encoding"
)
->
fetch
(
\PDO
::
FETCH_COLUMN
));
}
/**
* @return array
*/
public
function
getValidCharsets
()
{
return
array
(
array
(
"UTF8"
),
array
(
"LATIN1"
)
);
}
}
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