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
99c1b213
Unverified
Commit
99c1b213
authored
Jul 06, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename classes in Driver\PDO* namespaces
parent
4ec17a7f
Changes
29
Show whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
108 additions
and
128 deletions
+108
-128
UPGRADE.md
UPGRADE.md
+12
-0
psalm.xml
psalm.xml
+2
-2
Driver.php
src/Driver/PDO/MySQL/Driver.php
+1
-4
Driver.php
src/Driver/PDO/OCI/Driver.php
+1
-9
Driver.php
src/Driver/PDO/PgSQL/Driver.php
+1
-4
Connection.php
src/Driver/PDO/SQLSrv/Connection.php
+1
-1
Driver.php
src/Driver/PDO/SQLSrv/Driver.php
+1
-4
Statement.php
src/Driver/PDO/SQLSrv/Statement.php
+1
-4
Driver.php
src/Driver/PDO/SQLite/Driver.php
+1
-4
DriverManager.php
src/DriverManager.php
+14
-18
TableGenerator.php
src/Id/TableGenerator.php
+1
-1
ConnectionTest.php
tests/ConnectionTest.php
+1
-1
DriverTest.php
tests/Driver/PDO/MySQL/DriverTest.php
+2
-2
DriverTest.php
tests/Driver/PDO/OCI/DriverTest.php
+2
-2
DriverTest.php
tests/Driver/PDO/PgSQL/DriverTest.php
+11
-12
DriverTest.php
tests/Driver/PDO/SQLSrv/DriverTest.php
+2
-2
DriverTest.php
tests/Driver/PDO/SQLite/DriverTest.php
+2
-2
DriverManagerTest.php
tests/DriverManagerTest.php
+21
-22
BlobTest.php
tests/Functional/BlobTest.php
+2
-2
ConnectionTest.php
tests/Functional/Driver/PDO/ConnectionTest.php
+5
-8
DriverTest.php
tests/Functional/Driver/PDO/MySQL/DriverTest.php
+2
-2
DriverTest.php
tests/Functional/Driver/PDO/OCI/DriverTest.php
+2
-2
ConnectionTest.php
tests/Functional/Driver/PDO/PgSQL/ConnectionTest.php
+4
-4
DriverTest.php
tests/Functional/Driver/PDO/PgSQL/DriverTest.php
+2
-2
DriverTest.php
tests/Functional/Driver/PDO/SQLSrv/DriverTest.php
+3
-3
DriverTest.php
tests/Functional/Driver/PDO/SQLite/DriverTest.php
+2
-2
StatementTest.php
tests/Functional/StatementTest.php
+5
-5
TypeConversionTest.php
tests/Functional/TypeConversionTest.php
+2
-2
BinaryTest.php
tests/Functional/Types/BinaryTest.php
+2
-2
No files found.
UPGRADE.md
View file @
99c1b213
# Upgrade to 3.0
## BC BREAK: PDO-based driver classes are moved under the PDO namespace
The following classes have been renamed:
-
`PDOMySql\Driver`
→
`PDO\MySQL\Driver`
-
`PDOOracle\Driver`
→
`PDO\OCI\Driver`
-
`PDOPgSql\Driver`
→
`PDO\PgSQL\Driver`
-
`PDOSqlite\Driver`
→
`PDO\SQLite\Driver`
-
`PDOSqlsrv\Driver`
→
`PDO\SQLSrv\Driver`
-
`PDOSqlsrv\Connection`
→
`PDO\SQLSrv\Connection`
-
`PDOSqlsrv\Statement`
→
`PDO\SQLSrv\Statement`
## BC BREAK: Changes schema manager instantiation.
1.
The
`$platform`
argument of all schema manager constructors is no longer optional.
...
...
psalm.xml
View file @
99c1b213
...
...
@@ -37,7 +37,7 @@
<!--
Fixing these issues requires an API change
-->
<file
name=
"src/Driver/PDO
Sqls
rv/Connection.php"
/>
<file
name=
"src/Driver/PDO
/SQLS
rv/Connection.php"
/>
<file
name=
"src/Driver/SQLSrv/Connection.php"
/>
</errorLevel>
</FalsableReturnStatement>
...
...
@@ -64,7 +64,7 @@
Requires a release of
https://github.com/JetBrains/phpstorm-stubs/pull/732
-->
<file
name=
"tests/Driver/PDO
PgSql
/DriverTest.php"
/>
<file
name=
"tests/Driver/PDO
/PgSQL
/DriverTest.php"
/>
</errorLevel>
</UndefinedConstant>
<UndefinedClass>
...
...
src/Driver/PDO
MySql
/Driver.php
→
src/Driver/PDO
/MySQL
/Driver.php
View file @
99c1b213
<?php
namespace
Doctrine\DBAL\Driver\PDO
MySql
;
namespace
Doctrine\DBAL\Driver\PDO
\MySQL
;
use
Doctrine\DBAL\Driver\AbstractMySQLDriver
;
use
Doctrine\DBAL\Driver\PDO\Connection
;
use
PDO
;
/**
* PDO MySql driver.
*/
final
class
Driver
extends
AbstractMySQLDriver
{
/**
...
...
src/Driver/PDO
Oracle
/Driver.php
→
src/Driver/PDO
/OCI
/Driver.php
View file @
99c1b213
<?php
namespace
Doctrine\DBAL\Driver\PDO
Oracle
;
namespace
Doctrine\DBAL\Driver\PDO
\OCI
;
use
Doctrine\DBAL\Driver\AbstractOracleDriver
;
use
Doctrine\DBAL\Driver\PDO\Connection
;
use
PDO
;
/**
* PDO Oracle driver.
*
* WARNING: This driver gives us segfaults in our testsuites on CLOB and other
* stuff. PDO Oracle is not maintained by Oracle or anyone in the PHP community,
* which leads us to the recommendation to use the "oci8" driver to connect
* to Oracle instead.
*/
final
class
Driver
extends
AbstractOracleDriver
{
/**
...
...
src/Driver/PDO
PgSql
/Driver.php
→
src/Driver/PDO
/PgSQL
/Driver.php
View file @
99c1b213
<?php
namespace
Doctrine\DBAL\Driver\PDO
PgSql
;
namespace
Doctrine\DBAL\Driver\PDO
\PgSQL
;
use
Doctrine\DBAL\Driver\AbstractPostgreSQLDriver
;
use
Doctrine\DBAL\Driver\PDO\Connection
;
...
...
@@ -8,9 +8,6 @@ use PDO;
use
function
defined
;
/**
* Driver that connects through pdo_pgsql.
*/
final
class
Driver
extends
AbstractPostgreSQLDriver
{
/**
...
...
src/Driver/PDO
Sqls
rv/Connection.php
→
src/Driver/PDO
/SQLS
rv/Connection.php
View file @
99c1b213
<?php
namespace
Doctrine\DBAL\Driver\PDO
Sqls
rv
;
namespace
Doctrine\DBAL\Driver\PDO
\SQLS
rv
;
use
Doctrine\DBAL\Driver\PDO\Connection
as
PDOConnection
;
use
Doctrine\DBAL\Driver\Result
;
...
...
src/Driver/PDO
Sqls
rv/Driver.php
→
src/Driver/PDO
/SQLS
rv/Driver.php
View file @
99c1b213
<?php
namespace
Doctrine\DBAL\Driver\PDO
Sqls
rv
;
namespace
Doctrine\DBAL\Driver\PDO
\SQLS
rv
;
use
Doctrine\DBAL\Driver\AbstractSQLServerDriver
;
use
Doctrine\DBAL\Driver\AbstractSQLServerDriver\Exception\PortWithoutHost
;
...
...
@@ -11,9 +11,6 @@ use PDO;
use
function
is_int
;
use
function
sprintf
;
/**
* The PDO-based Sqlsrv driver.
*/
final
class
Driver
extends
AbstractSQLServerDriver
{
/**
...
...
src/Driver/PDO
Sqls
rv/Statement.php
→
src/Driver/PDO
/SQLS
rv/Statement.php
View file @
99c1b213
<?php
namespace
Doctrine\DBAL\Driver\PDO
Sqls
rv
;
namespace
Doctrine\DBAL\Driver\PDO
\SQLS
rv
;
use
Doctrine\DBAL\Driver\PDO\Statement
as
PDOStatement
;
use
Doctrine\DBAL\Driver\Result
;
...
...
@@ -8,9 +8,6 @@ use Doctrine\DBAL\Driver\Statement as StatementInterface;
use
Doctrine\DBAL\ParameterType
;
use
PDO
;
/**
* PDO SQL Server Statement
*/
final
class
Statement
implements
StatementInterface
{
/** @var PDOStatement */
...
...
src/Driver/PDO
Sql
ite/Driver.php
→
src/Driver/PDO
/SQL
ite/Driver.php
View file @
99c1b213
<?php
namespace
Doctrine\DBAL\Driver\PDO
Sql
ite
;
namespace
Doctrine\DBAL\Driver\PDO
\SQL
ite
;
use
Doctrine\DBAL\Driver\AbstractSQLiteDriver
;
use
Doctrine\DBAL\Driver\PDO\Connection
;
...
...
@@ -8,9 +8,6 @@ use Doctrine\DBAL\Platforms\SqlitePlatform;
use
function
array_merge
;
/**
* The PDO Sqlite driver.
*/
final
class
Driver
extends
AbstractSQLiteDriver
{
/** @var mixed[] */
...
...
src/DriverManager.php
View file @
99c1b213
...
...
@@ -3,15 +3,11 @@
namespace
Doctrine\DBAL
;
use
Doctrine\Common\EventManager
;
use
Doctrine\DBAL\Driver\IBMDB2\Driver
as
IBMDB2Driver
;
use
Doctrine\DBAL\Driver\Mysqli\Driver
as
MySQLiDriver
;
use
Doctrine\DBAL\Driver\OCI8\Driver
as
OCI8Driver
;
use
Doctrine\DBAL\Driver\PDOMySql\Driver
as
PDOMySQLDriver
;
use
Doctrine\DBAL\Driver\PDOOracle\Driver
as
PDOOCIDriver
;
use
Doctrine\DBAL\Driver\PDOPgSql\Driver
as
PDOPgSQLDriver
;
use
Doctrine\DBAL\Driver\PDOSqlite\Driver
as
PDOSQLiteDriver
;
use
Doctrine\DBAL\Driver\PDOSqlsrv\Driver
as
PDOSQLSrvDriver
;
use
Doctrine\DBAL\Driver\SQLSrv\Driver
as
SQLSrvDriver
;
use
Doctrine\DBAL\Driver\IBMDB2
;
use
Doctrine\DBAL\Driver\Mysqli
;
use
Doctrine\DBAL\Driver\OCI8
;
use
Doctrine\DBAL\Driver\PDO
;
use
Doctrine\DBAL\Driver\SQLSrv
;
use
function
array_keys
;
use
function
array_map
;
...
...
@@ -42,15 +38,15 @@ final class DriverManager
* @var string[]
*/
private
static
$_driverMap
=
[
'pdo_mysql'
=>
PDO
MySQL
Driver
::
class
,
'pdo_sqlite'
=>
PDO
SQLite
Driver
::
class
,
'pdo_pgsql'
=>
PDO
PgSQL
Driver
::
class
,
'pdo_oci'
=>
PDO
OCI
Driver
::
class
,
'oci8'
=>
OCI8Driver
::
class
,
'ibm_db2'
=>
IBMDB2Driver
::
class
,
'pdo_sqlsrv'
=>
PDO
SQLSrv
Driver
::
class
,
'mysqli'
=>
My
SQLi
Driver
::
class
,
'sqlsrv'
=>
SQLSrvDriver
::
class
,
'pdo_mysql'
=>
PDO
\MySQL\
Driver
::
class
,
'pdo_sqlite'
=>
PDO
\SQLite\
Driver
::
class
,
'pdo_pgsql'
=>
PDO
\PgSQL\
Driver
::
class
,
'pdo_oci'
=>
PDO
\OCI\
Driver
::
class
,
'oci8'
=>
OCI8
\
Driver
::
class
,
'ibm_db2'
=>
IBMDB2
\
Driver
::
class
,
'pdo_sqlsrv'
=>
PDO
\SQLSrv\
Driver
::
class
,
'mysqli'
=>
My
sqli\
Driver
::
class
,
'sqlsrv'
=>
SQLSrv
\
Driver
::
class
,
];
/**
...
...
src/Id/TableGenerator.php
View file @
99c1b213
...
...
@@ -70,7 +70,7 @@ class TableGenerator
*/
public
function
__construct
(
Connection
$conn
,
$generatorTableName
=
'sequences'
)
{
if
(
$conn
->
getDriver
()
instanceof
Driver\PDO
Sql
ite\Driver
)
{
if
(
$conn
->
getDriver
()
instanceof
Driver\PDO
\SQL
ite\Driver
)
{
throw
new
DBALException
(
'Cannot use TableGenerator with SQLite.'
);
}
...
...
tests/ConnectionTest.php
View file @
99c1b213
...
...
@@ -110,7 +110,7 @@ class ConnectionTest extends TestCase
public
function
testGetDriver
()
:
void
{
self
::
assertInstanceOf
(
\Doctrine\DBAL\Driver\PDOMySql
\Driver
::
class
,
$this
->
connection
->
getDriver
());
self
::
assertInstanceOf
(
Driver\PDO\MySQL
\Driver
::
class
,
$this
->
connection
->
getDriver
());
}
public
function
testGetEventManager
()
:
void
...
...
tests/Driver/PDO
MySql
/DriverTest.php
→
tests/Driver/PDO
/MySQL
/DriverTest.php
View file @
99c1b213
<?php
namespace
Doctrine\DBAL\Tests\Driver\PDO
MySql
;
namespace
Doctrine\DBAL\Tests\Driver\PDO
\MySQL
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\PDO
MySql
\Driver
;
use
Doctrine\DBAL\Driver\PDO
\MySQL
\Driver
;
use
Doctrine\DBAL\Tests\Driver\AbstractMySQLDriverTest
;
class
DriverTest
extends
AbstractMySQLDriverTest
...
...
tests/Driver/PDO
Oracle
/DriverTest.php
→
tests/Driver/PDO
/OCI
/DriverTest.php
View file @
99c1b213
<?php
namespace
Doctrine\DBAL\Tests\Driver\PDO
Oracle
;
namespace
Doctrine\DBAL\Tests\Driver\PDO
\OCI
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\PDO
Oracle
\Driver
;
use
Doctrine\DBAL\Driver\PDO
\OCI
\Driver
;
use
Doctrine\DBAL\Tests\Driver\AbstractOracleDriverTest
;
class
DriverTest
extends
AbstractOracleDriverTest
...
...
tests/Driver/PDO
PgSql
/DriverTest.php
→
tests/Driver/PDO
/PgSQL
/DriverTest.php
View file @
99c1b213
<?php
namespace
Doctrine\DBAL\Tests\Driver\PDO
PgSql
;
namespace
Doctrine\DBAL\Tests\Driver\PDO
\PgSQL
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\Connection
;
use
Doctrine\DBAL\Driver\PDO
\Connection
as
PDOConnection
;
use
Doctrine\DBAL\Driver\PDO
PgSql
\Driver
;
use
Doctrine\DBAL\Driver\PDO
;
use
Doctrine\DBAL\Driver\PDO
\PgSQL
\Driver
;
use
Doctrine\DBAL\Tests\Driver\AbstractPostgreSQLDriverTest
;
use
Doctrine\DBAL\Tests\TestUtil
;
use
PDO
;
use
function
array_merge
;
...
...
@@ -32,9 +31,9 @@ class DriverTest extends AbstractPostgreSQLDriverTest
{
$connection
=
$this
->
connect
([]);
self
::
assertInstanceOf
(
PDOConnection
::
class
,
$connection
);
self
::
assertInstanceOf
(
PDO
\
Connection
::
class
,
$connection
);
self
::
assertTrue
(
$connection
->
getWrappedConnection
()
->
getAttribute
(
PDO
::
PGSQL_ATTR_DISABLE_PREPARES
)
$connection
->
getWrappedConnection
()
->
getAttribute
(
\
PDO
::
PGSQL_ATTR_DISABLE_PREPARES
)
);
}
...
...
@@ -44,12 +43,12 @@ class DriverTest extends AbstractPostgreSQLDriverTest
public
function
testConnectionDoesNotDisablePreparesWhenAttributeDefined
()
:
void
{
$connection
=
$this
->
connect
(
[
PDO
::
PGSQL_ATTR_DISABLE_PREPARES
=>
false
]
[
\
PDO
::
PGSQL_ATTR_DISABLE_PREPARES
=>
false
]
);
self
::
assertInstanceOf
(
PDOConnection
::
class
,
$connection
);
self
::
assertInstanceOf
(
PDO
\
Connection
::
class
,
$connection
);
self
::
assertNotTrue
(
$connection
->
getWrappedConnection
()
->
getAttribute
(
PDO
::
PGSQL_ATTR_DISABLE_PREPARES
)
$connection
->
getWrappedConnection
()
->
getAttribute
(
\
PDO
::
PGSQL_ATTR_DISABLE_PREPARES
)
);
}
...
...
@@ -59,12 +58,12 @@ class DriverTest extends AbstractPostgreSQLDriverTest
public
function
testConnectionDisablePreparesWhenDisablePreparesIsExplicitlyDefined
()
:
void
{
$connection
=
$this
->
connect
(
[
PDO
::
PGSQL_ATTR_DISABLE_PREPARES
=>
true
]
[
\
PDO
::
PGSQL_ATTR_DISABLE_PREPARES
=>
true
]
);
self
::
assertInstanceOf
(
PDOConnection
::
class
,
$connection
);
self
::
assertInstanceOf
(
PDO
\
Connection
::
class
,
$connection
);
self
::
assertTrue
(
$connection
->
getWrappedConnection
()
->
getAttribute
(
PDO
::
PGSQL_ATTR_DISABLE_PREPARES
)
$connection
->
getWrappedConnection
()
->
getAttribute
(
\
PDO
::
PGSQL_ATTR_DISABLE_PREPARES
)
);
}
...
...
tests/Driver/PDO
Sqls
rv/DriverTest.php
→
tests/Driver/PDO
/SQLS
rv/DriverTest.php
View file @
99c1b213
<?php
namespace
Doctrine\DBAL\Tests\Driver\PDO
Sqls
rv
;
namespace
Doctrine\DBAL\Tests\Driver\PDO
\SQLS
rv
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\PDO
Sqls
rv\Driver
;
use
Doctrine\DBAL\Driver\PDO
\SQLS
rv\Driver
;
use
Doctrine\DBAL\Tests\Driver\AbstractSQLServerDriverTest
;
class
DriverTest
extends
AbstractSQLServerDriverTest
...
...
tests/Driver/PDO
Sql
ite/DriverTest.php
→
tests/Driver/PDO
/SQL
ite/DriverTest.php
View file @
99c1b213
<?php
namespace
Doctrine\DBAL\Tests\Driver\PDO
Sql
ite
;
namespace
Doctrine\DBAL\Tests\Driver\PDO
\SQL
ite
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\PDO
Sql
ite\Driver
;
use
Doctrine\DBAL\Driver\PDO
\SQL
ite\Driver
;
use
Doctrine\DBAL\Tests\Driver\AbstractSQLiteDriverTest
;
class
DriverTest
extends
AbstractSQLiteDriverTest
...
...
tests/DriverManagerTest.php
View file @
99c1b213
...
...
@@ -6,8 +6,7 @@ use Doctrine\DBAL\Connection;
use
Doctrine\DBAL\Connections\PrimaryReadReplicaConnection
;
use
Doctrine\DBAL\DBALException
;
use
Doctrine\DBAL\Driver
;
use
Doctrine\DBAL\Driver\PDOMySql\Driver
as
PDOMySQLDriver
;
use
Doctrine\DBAL\Driver\PDOSqlite\Driver
as
PDOSqliteDriver
;
use
Doctrine\DBAL\Driver\PDO
;
use
Doctrine\DBAL\Driver\SQLSrv\Driver
as
SQLSrvDriver
;
use
Doctrine\DBAL\DriverManager
;
use
Doctrine\DBAL\Platforms\AbstractPlatform
;
...
...
@@ -93,10 +92,10 @@ class DriverManagerTest extends TestCase
public
function
testValidDriverClass
()
:
void
{
$options
=
[
'driverClass'
=>
PDO
MySQL
Driver
::
class
];
$options
=
[
'driverClass'
=>
PDO
\MySQL\
Driver
::
class
];
$conn
=
DriverManager
::
getConnection
(
$options
);
self
::
assertInstanceOf
(
PDO
MySQL
Driver
::
class
,
$conn
->
getDriver
());
self
::
assertInstanceOf
(
PDO
\MySQL\
Driver
::
class
,
$conn
->
getDriver
());
}
public
function
testDatabaseUrlPrimaryReplica
()
:
void
...
...
@@ -113,7 +112,7 @@ class DriverManagerTest extends TestCase
$conn
=
DriverManager
::
getConnection
(
$options
);
$params
=
$conn
->
getParams
();
self
::
assertInstanceOf
(
PDO
MySQL
Driver
::
class
,
$conn
->
getDriver
());
self
::
assertInstanceOf
(
PDO
\MySQL\
Driver
::
class
,
$conn
->
getDriver
());
$expected
=
[
'user'
=>
'foo'
,
...
...
@@ -173,7 +172,7 @@ class DriverManagerTest extends TestCase
'password'
=>
'bar'
,
'host'
=>
'localhost'
,
'dbname'
=>
'baz'
,
'driver'
=>
PDO
MySQL
Driver
::
class
,
'driver'
=>
PDO
\MySQL\
Driver
::
class
,
],
],
'simple URL with port'
=>
[
...
...
@@ -184,49 +183,49 @@ class DriverManagerTest extends TestCase
'host'
=>
'localhost'
,
'port'
=>
11211
,
'dbname'
=>
'baz'
,
'driver'
=>
PDO
MySQL
Driver
::
class
,
'driver'
=>
PDO
\MySQL\
Driver
::
class
,
],
],
'sqlite relative URL with host'
=>
[
'sqlite://localhost/foo/dbname.sqlite'
,
[
'path'
=>
'foo/dbname.sqlite'
,
'driver'
=>
PDO
Sqlite
Driver
::
class
,
'driver'
=>
PDO
\SQLite\
Driver
::
class
,
],
],
'sqlite absolute URL with host'
=>
[
'sqlite://localhost//tmp/dbname.sqlite'
,
[
'path'
=>
'/tmp/dbname.sqlite'
,
'driver'
=>
PDO
Sqlite
Driver
::
class
,
'driver'
=>
PDO
\SQLite\
Driver
::
class
,
],
],
'sqlite relative URL without host'
=>
[
'sqlite:///foo/dbname.sqlite'
,
[
'path'
=>
'foo/dbname.sqlite'
,
'driver'
=>
PDO
Sqlite
Driver
::
class
,
'driver'
=>
PDO
\SQLite\
Driver
::
class
,
],
],
'sqlite absolute URL without host'
=>
[
'sqlite:////tmp/dbname.sqlite'
,
[
'path'
=>
'/tmp/dbname.sqlite'
,
'driver'
=>
PDO
Sqlite
Driver
::
class
,
'driver'
=>
PDO
\SQLite\
Driver
::
class
,
],
],
'sqlite memory'
=>
[
'sqlite:///:memory:'
,
[
'memory'
=>
true
,
'driver'
=>
PDO
Sqlite
Driver
::
class
,
'driver'
=>
PDO
\SQLite\
Driver
::
class
,
],
],
'sqlite memory with host'
=>
[
'sqlite://localhost/:memory:'
,
[
'memory'
=>
true
,
'driver'
=>
PDO
Sqlite
Driver
::
class
,
'driver'
=>
PDO
\SQLite\
Driver
::
class
,
],
],
'params parsed from URL override individual params'
=>
[
...
...
@@ -239,7 +238,7 @@ class DriverManagerTest extends TestCase
'password'
=>
'bar'
,
'host'
=>
'localhost'
,
'dbname'
=>
'baz'
,
'driver'
=>
PDO
MySQL
Driver
::
class
,
'driver'
=>
PDO
\MySQL\
Driver
::
class
,
],
],
'params not parsed from URL but individual params are preserved'
=>
[
...
...
@@ -253,7 +252,7 @@ class DriverManagerTest extends TestCase
'host'
=>
'localhost'
,
'port'
=>
1234
,
'dbname'
=>
'baz'
,
'driver'
=>
PDO
MySQL
Driver
::
class
,
'driver'
=>
PDO
\MySQL\
Driver
::
class
,
],
],
'query params from URL are used as extra params'
=>
[
...
...
@@ -281,7 +280,7 @@ class DriverManagerTest extends TestCase
'password'
=>
'bar'
,
'host'
=>
'localhost'
,
'dbname'
=>
'baz'
,
'driver'
=>
PDO
MySQL
Driver
::
class
,
'driver'
=>
PDO
\MySQL\
Driver
::
class
,
],
],
'simple URL with percent encoding'
=>
[
...
...
@@ -291,7 +290,7 @@ class DriverManagerTest extends TestCase
'password'
=>
'bar/'
,
'host'
=>
'localhost'
,
'dbname'
=>
'baz+baz@'
,
'driver'
=>
PDO
MySQL
Driver
::
class
,
'driver'
=>
PDO
\MySQL\
Driver
::
class
,
],
],
'simple URL with percent sign in password'
=>
[
...
...
@@ -301,7 +300,7 @@ class DriverManagerTest extends TestCase
'password'
=>
'bar%bar'
,
'host'
=>
'localhost'
,
'dbname'
=>
'baz'
,
'driver'
=>
PDO
MySQL
Driver
::
class
,
'driver'
=>
PDO
\MySQL\
Driver
::
class
,
],
],
...
...
@@ -320,7 +319,7 @@ class DriverManagerTest extends TestCase
'password'
=>
'bar'
,
'host'
=>
'localhost'
,
'dbname'
=>
'baz'
,
'driver'
=>
PDO
MySQL
Driver
::
class
,
'driver'
=>
PDO
\MySQL\
Driver
::
class
,
],
],
'URL without scheme but custom driver'
=>
[
...
...
@@ -360,7 +359,7 @@ class DriverManagerTest extends TestCase
'password'
=>
'bar'
,
'host'
=>
'localhost'
,
'dbname'
=>
'baz'
,
'driver'
=>
PDO
MySQL
Driver
::
class
,
'driver'
=>
PDO
\MySQL\
Driver
::
class
,
],
],
'URL with default custom driver'
=>
[
...
...
@@ -373,7 +372,7 @@ class DriverManagerTest extends TestCase
'password'
=>
'bar'
,
'host'
=>
'localhost'
,
'dbname'
=>
'baz'
,
'driver'
=>
PDO
MySQL
Driver
::
class
,
'driver'
=>
PDO
\MySQL\
Driver
::
class
,
],
],
'URL with default driver and default custom driver'
=>
[
...
...
@@ -387,7 +386,7 @@ class DriverManagerTest extends TestCase
'password'
=>
'bar'
,
'host'
=>
'localhost'
,
'dbname'
=>
'baz'
,
'driver'
=>
PDO
MySQL
Driver
::
class
,
'driver'
=>
PDO
\MySQL\
Driver
::
class
,
],
],
];
...
...
tests/Functional/BlobTest.php
View file @
99c1b213
...
...
@@ -3,7 +3,7 @@
namespace
Doctrine\DBAL\Tests\Functional
;
use
Doctrine\DBAL\Driver\OCI8\Driver
as
OCI8Driver
;
use
Doctrine\DBAL\Driver\PDO
Oracle\Driver
as
PDOOracleDriver
;
use
Doctrine\DBAL\Driver\PDO
;
use
Doctrine\DBAL\ParameterType
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Tests\FunctionalTestCase
;
...
...
@@ -22,7 +22,7 @@ class BlobTest extends FunctionalTestCase
{
parent
::
setUp
();
if
(
$this
->
connection
->
getDriver
()
instanceof
PDO
Oracle
Driver
)
{
if
(
$this
->
connection
->
getDriver
()
instanceof
PDO
\OCI\
Driver
)
{
// inserting BLOBs as streams on Oracle requires Oracle-specific SQL syntax which is currently not supported
// see http://php.net/manual/en/pdo.lobs.php#example-1035
self
::
markTestSkipped
(
'DBAL doesn\'t support storing LOBs represented as streams using PDO_OCI'
);
...
...
tests/Functional/Driver/PDO/ConnectionTest.php
View file @
99c1b213
...
...
@@ -2,13 +2,10 @@
namespace
Doctrine\DBAL\Tests\Functional\Driver\PDO
;
use
Doctrine\DBAL\Driver\PDO
;
use
Doctrine\DBAL\Driver\PDO\Connection
;
use
Doctrine\DBAL\Driver\PDO\Exception
;
use
Doctrine\DBAL\Driver\PDOOracle\Driver
as
PDOOracleDriver
;
use
Doctrine\DBAL\Driver\PDOPgSql\Driver
as
PDOPgSQLDriver
;
use
Doctrine\DBAL\Driver\PDOSqlsrv\Driver
as
PDOSQLSRVDriver
;
use
Doctrine\DBAL\Tests\FunctionalTestCase
;
use
PDO
;
use
function
get_class
;
use
function
sprintf
;
...
...
@@ -66,7 +63,7 @@ class ConnectionTest extends FunctionalTestCase
{
$driver
=
$this
->
connection
->
getDriver
();
if
(
$driver
instanceof
PDO
SQLSRV
Driver
)
{
if
(
$driver
instanceof
PDO
\SQLSrv\
Driver
)
{
self
::
markTestSkipped
(
'pdo_sqlsrv does not allow setting PDO::ATTR_EMULATE_PREPARES at connection level.'
);
}
...
...
@@ -74,8 +71,8 @@ class ConnectionTest extends FunctionalTestCase
// even though emulated prepared statements are disabled,
// so an exception is thrown only eventually.
if
(
$driver
instanceof
PDO
Oracle
Driver
||
$driver
instanceof
PDO
PgSQL
Driver
$driver
instanceof
PDO
\OCI\
Driver
||
$driver
instanceof
PDO
\PgSQL\
Driver
)
{
self
::
markTestSkipped
(
sprintf
(
'The underlying implementation of the %s driver does not check the query to be prepared server-side.'
,
...
...
@@ -87,7 +84,7 @@ class ConnectionTest extends FunctionalTestCase
// so that PDO actually communicates with the database server to check the query.
$this
->
driverConnection
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
ATTR_EMULATE_PREPARES
,
false
);
->
setAttribute
(
\
PDO
::
ATTR_EMULATE_PREPARES
,
false
);
$this
->
expectException
(
Exception
::
class
);
...
...
tests/Functional/Driver/PDO
MySql
/DriverTest.php
→
tests/Functional/Driver/PDO
/MySQL
/DriverTest.php
View file @
99c1b213
<?php
namespace
Doctrine\DBAL\Tests\Functional\Driver\PDO
MySql
;
namespace
Doctrine\DBAL\Tests\Functional\Driver\PDO
\MySQL
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\PDO
MySql
\Driver
;
use
Doctrine\DBAL\Driver\PDO
\MySQL
\Driver
;
use
Doctrine\DBAL\Tests\Functional\Driver\AbstractDriverTest
;
use
function
extension_loaded
;
...
...
tests/Functional/Driver/PDO
Oracle
/DriverTest.php
→
tests/Functional/Driver/PDO
/OCI
/DriverTest.php
View file @
99c1b213
<?php
namespace
Doctrine\DBAL\Tests\Functional\Driver\PDO
Oracle
;
namespace
Doctrine\DBAL\Tests\Functional\Driver\PDO
\OCI
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\PDO
Oracle
\Driver
;
use
Doctrine\DBAL\Driver\PDO
\OCI
\Driver
;
use
Doctrine\DBAL\Tests\Functional\Driver\AbstractDriverTest
;
use
function
extension_loaded
;
...
...
tests/Functional/Driver/PDO
PgSql
/ConnectionTest.php
→
tests/Functional/Driver/PDO
/PgSQL
/ConnectionTest.php
View file @
99c1b213
<?php
namespace
Doctrine\DBAL\Tests\Functional\Driver\PDO
PgSql
;
namespace
Doctrine\DBAL\Tests\Functional\Driver\PDO
\PgSQL
;
use
Doctrine\DBAL\Driver\PDO\PgSQL\Driver
;
use
Doctrine\DBAL\DriverManager
;
use
Doctrine\DBAL\Platforms\PostgreSQL94Platform
;
use
Doctrine\DBAL\Tests\FunctionalTestCase
;
use
function
extension_loaded
;
...
...
@@ -18,11 +18,11 @@ class ConnectionTest extends FunctionalTestCase
parent
::
setUp
();
if
(
$this
->
connection
->
getD
atabasePlatform
()
instanceof
PostgreSQL94Platform
)
{
if
(
$this
->
connection
->
getD
river
()
instanceof
Driver
)
{
return
;
}
self
::
markTestSkipped
(
'
PDOP
gsql only test.'
);
self
::
markTestSkipped
(
'
pdo_p
gsql only test.'
);
}
/**
...
...
tests/Functional/Driver/PDO
PgSql
/DriverTest.php
→
tests/Functional/Driver/PDO
/PgSQL
/DriverTest.php
View file @
99c1b213
<?php
namespace
Doctrine\DBAL\Tests\Functional\Driver\PDO
PgSql
;
namespace
Doctrine\DBAL\Tests\Functional\Driver\PDO
\PgSQL
;
use
Doctrine\DBAL\Connection
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\PDO
PgSql
\Driver
;
use
Doctrine\DBAL\Driver\PDO
\PgSQL
\Driver
;
use
Doctrine\DBAL\Tests\Functional\Driver\AbstractDriverTest
;
use
Doctrine\DBAL\Tests\TestUtil
;
...
...
tests/Functional/Driver/PDO
Sqls
rv/DriverTest.php
→
tests/Functional/Driver/PDO
/SQLS
rv/DriverTest.php
View file @
99c1b213
<?php
namespace
Doctrine\DBAL\Tests\Functional\Driver\PDO
Sqls
rv
;
namespace
Doctrine\DBAL\Tests\Functional\Driver\PDO
\SQLS
rv
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\PDO
Sqls
rv\Connection
;
use
Doctrine\DBAL\Driver\PDO
Sqls
rv\Driver
;
use
Doctrine\DBAL\Driver\PDO
\SQLS
rv\Connection
;
use
Doctrine\DBAL\Driver\PDO
\SQLS
rv\Driver
;
use
Doctrine\DBAL\Tests\Functional\Driver\AbstractDriverTest
;
use
Doctrine\DBAL\Tests\TestUtil
;
use
PDO
;
...
...
tests/Functional/Driver/PDO
Sql
ite/DriverTest.php
→
tests/Functional/Driver/PDO
/SQL
ite/DriverTest.php
View file @
99c1b213
<?php
namespace
Doctrine\DBAL\Tests\Functional\Driver\PDO
Sql
ite
;
namespace
Doctrine\DBAL\Tests\Functional\Driver\PDO
\SQL
ite
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\PDO
Sql
ite\Driver
;
use
Doctrine\DBAL\Driver\PDO
\SQL
ite\Driver
;
use
Doctrine\DBAL\Tests\Functional\Driver\AbstractDriverTest
;
use
function
extension_loaded
;
...
...
tests/Functional/StatementTest.php
View file @
99c1b213
...
...
@@ -3,7 +3,7 @@
namespace
Doctrine\DBAL\Tests\Functional
;
use
Doctrine\DBAL\Driver\Exception
;
use
Doctrine\DBAL\Driver\PDO
Oracle\Driver
as
PDOOracleDriver
;
use
Doctrine\DBAL\Driver\PDO
;
use
Doctrine\DBAL\Driver\Result
;
use
Doctrine\DBAL\ParameterType
;
use
Doctrine\DBAL\Schema\Table
;
...
...
@@ -27,7 +27,7 @@ class StatementTest extends FunctionalTestCase
public
function
testStatementIsReusableAfterFreeingResult
()
:
void
{
if
(
$this
->
connection
->
getDriver
()
instanceof
PDO
Oracle
Driver
)
{
if
(
$this
->
connection
->
getDriver
()
instanceof
PDO
\OCI\
Driver
)
{
self
::
markTestIncomplete
(
'See https://bugs.php.net/bug.php?id=77181'
);
}
...
...
@@ -50,7 +50,7 @@ class StatementTest extends FunctionalTestCase
public
function
testReuseStatementWithLongerResults
()
:
void
{
if
(
$this
->
connection
->
getDriver
()
instanceof
PDO
Oracle
Driver
)
{
if
(
$this
->
connection
->
getDriver
()
instanceof
PDO
\OCI\
Driver
)
{
self
::
markTestIncomplete
(
'PDO_OCI doesn\'t support fetching blobs via PDOStatement::fetchAll()'
);
}
...
...
@@ -87,7 +87,7 @@ class StatementTest extends FunctionalTestCase
public
function
testFetchLongBlob
()
:
void
{
if
(
$this
->
connection
->
getDriver
()
instanceof
PDO
Oracle
Driver
)
{
if
(
$this
->
connection
->
getDriver
()
instanceof
PDO
\OCI\
Driver
)
{
// inserting BLOBs as streams on Oracle requires Oracle-specific SQL syntax which is currently not supported
// see http://php.net/manual/en/pdo.lobs.php#example-1035
self
::
markTestSkipped
(
'DBAL doesn\'t support storing LOBs represented as streams using PDO_OCI'
);
...
...
@@ -153,7 +153,7 @@ EOF
public
function
testReuseStatementAfterFreeingResult
()
:
void
{
if
(
$this
->
connection
->
getDriver
()
instanceof
PDO
Oracle
Driver
)
{
if
(
$this
->
connection
->
getDriver
()
instanceof
PDO
\OCI\
Driver
)
{
self
::
markTestIncomplete
(
'See https://bugs.php.net/bug.php?id=77181'
);
}
...
...
tests/Functional/TypeConversionTest.php
View file @
99c1b213
...
...
@@ -3,7 +3,7 @@
namespace
Doctrine\DBAL\Tests\Functional
;
use
DateTime
;
use
Doctrine\DBAL\Driver\PDO
Oracle\Driver
as
PDOOracleDriver
;
use
Doctrine\DBAL\Driver\PDO
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Tests\FunctionalTestCase
;
use
Doctrine\DBAL\Types\Type
;
...
...
@@ -120,7 +120,7 @@ class TypeConversionTest extends FunctionalTestCase
*/
public
function
testIdempotentConversionToString
(
string
$type
,
$originalValue
)
:
void
{
if
(
$type
===
'text'
&&
$this
->
connection
->
getDriver
()
instanceof
PDO
Oracle
Driver
)
{
if
(
$type
===
'text'
&&
$this
->
connection
->
getDriver
()
instanceof
PDO
\OCI\
Driver
)
{
// inserting BLOBs as streams on Oracle requires Oracle-specific SQL syntax which is currently not supported
// see http://php.net/manual/en/pdo.lobs.php#example-1035
self
::
markTestSkipped
(
'DBAL doesn\'t support storing LOBs represented as streams using PDO_OCI'
);
...
...
tests/Functional/Types/BinaryTest.php
View file @
99c1b213
...
...
@@ -5,7 +5,7 @@ declare(strict_types=1);
namespace
Doctrine\DBAL\Tests\Functional\Types
;
use
Doctrine\DBAL\Driver\IBMDB2\Driver
;
use
Doctrine\DBAL\Driver\PDO
Oracle\Driver
as
PDOOracleDriver
;
use
Doctrine\DBAL\Driver\PDO
;
use
Doctrine\DBAL\ParameterType
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Tests\FunctionalTestCase
;
...
...
@@ -21,7 +21,7 @@ class BinaryTest extends FunctionalTestCase
{
parent
::
setUp
();
if
(
$this
->
connection
->
getDriver
()
instanceof
PDO
Oracle
Driver
)
{
if
(
$this
->
connection
->
getDriver
()
instanceof
PDO
\OCI\
Driver
)
{
self
::
markTestSkipped
(
'PDO_OCI doesn\'t support binding binary values'
);
}
...
...
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