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
45b57743
Unverified
Commit
45b57743
authored
Jan 27, 2018
by
Michael Moravec
Committed by
Marco Pivetta
Jan 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract Connection::TRANSACTION_* constants into TransactionIsolationLevel class
parent
e125a45c
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
112 additions
and
58 deletions
+112
-58
UPGRADE.md
UPGRADE.md
+6
-0
Connection.php
lib/Doctrine/DBAL/Connection.php
+12
-4
AbstractPlatform.php
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
+7
-7
MySqlPlatform.php
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
+2
-2
OraclePlatform.php
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
+5
-4
SQLAnywherePlatform.php
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
+6
-6
SqlitePlatform.php
lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
+5
-4
TransactionIsolationLevel.php
lib/Doctrine/DBAL/TransactionIsolationLevel.php
+32
-0
AbstractMySQLPlatformTestCase.php
...ne/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php
+5
-4
AbstractPostgreSqlPlatformTestCase.php
...sts/DBAL/Platforms/AbstractPostgreSqlPlatformTestCase.php
+5
-4
AbstractSQLServerPlatformTestCase.php
...ests/DBAL/Platforms/AbstractSQLServerPlatformTestCase.php
+9
-8
MySqlPlatformTest.php
tests/Doctrine/Tests/DBAL/Platforms/MySqlPlatformTest.php
+2
-2
OraclePlatformTest.php
tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php
+5
-4
SQLAnywherePlatformTest.php
...Doctrine/Tests/DBAL/Platforms/SQLAnywherePlatformTest.php
+6
-5
SqlitePlatformTest.php
tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php
+5
-4
No files found.
UPGRADE.md
View file @
45b57743
# Upgrade to 2.7
## Doctrine\DBAL\Connection::TRANSACTION_* constants deprecated
``Doctrine\DBAL\Connection::TRANSACTION_*``
were moved into
``Doctrine\DBAL\TransactionIsolationLevel``
class without the
``TRANSACTION_``
prefix.
# Upgrade to 2.6
## MINOR BC BREAK: `fetch()` and `fetchAll()` method signatures in `Doctrine\DBAL\Driver\ResultStatement`
...
...
lib/Doctrine/DBAL/Connection.php
View file @
45b57743
...
...
@@ -52,23 +52,31 @@ class Connection implements DriverConnection
{
/**
* Constant for transaction isolation level READ UNCOMMITTED.
*
* @deprecated Use TransactionIsolationLevel::READ_UNCOMMITTED.
*/
const
TRANSACTION_READ_UNCOMMITTED
=
1
;
public
const
TRANSACTION_READ_UNCOMMITTED
=
TransactionIsolationLevel
::
READ_UNCOMMITTED
;
/**
* Constant for transaction isolation level READ COMMITTED.
*
* @deprecated Use TransactionIsolationLevel::READ_COMMITTED.
*/
const
TRANSACTION_READ_COMMITTED
=
2
;
public
const
TRANSACTION_READ_COMMITTED
=
TransactionIsolationLevel
::
READ_COMMITTED
;
/**
* Constant for transaction isolation level REPEATABLE READ.
*
* @deprecated Use TransactionIsolationLevel::REPEATABLE_READ.
*/
const
TRANSACTION_REPEATABLE_READ
=
3
;
public
const
TRANSACTION_REPEATABLE_READ
=
TransactionIsolationLevel
::
REPEATABLE_READ
;
/**
* Constant for transaction isolation level SERIALIZABLE.
*
* @deprecated Use TransactionIsolationLevel::SERIALIZABLE.
*/
const
TRANSACTION_SERIALIZABLE
=
4
;
public
const
TRANSACTION_SERIALIZABLE
=
TransactionIsolationLevel
::
SERIALIZABLE
;
/**
* Represents an array of ints to be expanded by Doctrine SQL parsing.
...
...
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
View file @
45b57743
...
...
@@ -20,7 +20,6 @@
namespace
Doctrine\DBAL\Platforms
;
use
Doctrine\Common\EventManager
;
use
Doctrine\DBAL\Connection
;
use
Doctrine\DBAL\DBALException
;
use
Doctrine\DBAL\Event\SchemaAlterTableAddColumnEventArgs
;
use
Doctrine\DBAL\Event\SchemaAlterTableChangeColumnEventArgs
;
...
...
@@ -40,6 +39,7 @@ use Doctrine\DBAL\Schema\Index;
use
Doctrine\DBAL\Schema\Sequence
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\TransactionIsolationLevel
;
use
Doctrine\DBAL\Types
;
use
Doctrine\DBAL\Types\Type
;
...
...
@@ -2715,13 +2715,13 @@ abstract class AbstractPlatform
protected
function
_getTransactionIsolationLevelSQL
(
$level
)
{
switch
(
$level
)
{
case
Connection
::
TRANSACTION_
READ_UNCOMMITTED
:
case
TransactionIsolationLevel
::
READ_UNCOMMITTED
:
return
'READ UNCOMMITTED'
;
case
Connection
::
TRANSACTION_
READ_COMMITTED
:
case
TransactionIsolationLevel
::
READ_COMMITTED
:
return
'READ COMMITTED'
;
case
Connection
::
TRANSACTION_
REPEATABLE_READ
:
case
TransactionIsolationLevel
::
REPEATABLE_READ
:
return
'REPEATABLE READ'
;
case
Connection
::
TRANSACTION_
SERIALIZABLE
:
case
TransactionIsolationLevel
::
SERIALIZABLE
:
return
'SERIALIZABLE'
;
default
:
throw
new
\InvalidArgumentException
(
'Invalid isolation level:'
.
$level
);
...
...
@@ -3007,11 +3007,11 @@ abstract class AbstractPlatform
*
* @return int The default isolation level.
*
* @see
Doctrine\DBAL\Connection\TRANSACTION_* constants.
* @see
TransactionIsolationLevel
*/
public
function
getDefaultTransactionIsolationLevel
()
{
return
Connection
::
TRANSACTION_
READ_COMMITTED
;
return
TransactionIsolationLevel
::
READ_COMMITTED
;
}
/* supports*() methods */
...
...
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
View file @
45b57743
...
...
@@ -19,11 +19,11 @@
namespace
Doctrine\DBAL\Platforms
;
use
Doctrine\DBAL\Connection
;
use
Doctrine\DBAL\Schema\Identifier
;
use
Doctrine\DBAL\Schema\Index
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\TransactionIsolationLevel
;
use
Doctrine\DBAL\Types\BlobType
;
use
Doctrine\DBAL\Types\TextType
;
...
...
@@ -1136,6 +1136,6 @@ class MySqlPlatform extends AbstractPlatform
*/
public
function
getDefaultTransactionIsolationLevel
()
{
return
Connection
::
TRANSACTION_
REPEATABLE_READ
;
return
TransactionIsolationLevel
::
REPEATABLE_READ
;
}
}
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
View file @
45b57743
...
...
@@ -26,6 +26,7 @@ use Doctrine\DBAL\Schema\Index;
use
Doctrine\DBAL\Schema\Sequence
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\TransactionIsolationLevel
;
use
Doctrine\DBAL\Types\BinaryType
;
/**
...
...
@@ -244,12 +245,12 @@ class OraclePlatform extends AbstractPlatform
protected
function
_getTransactionIsolationLevelSQL
(
$level
)
{
switch
(
$level
)
{
case
\Doctrine\DBAL\Connection
::
TRANSACTION_
READ_UNCOMMITTED
:
case
TransactionIsolationLevel
::
READ_UNCOMMITTED
:
return
'READ UNCOMMITTED'
;
case
\Doctrine\DBAL\Connection
::
TRANSACTION_
READ_COMMITTED
:
case
TransactionIsolationLevel
::
READ_COMMITTED
:
return
'READ COMMITTED'
;
case
\Doctrine\DBAL\Connection
::
TRANSACTION_
REPEATABLE_READ
:
case
\Doctrine\DBAL\Connection
::
TRANSACTION_
SERIALIZABLE
:
case
TransactionIsolationLevel
::
REPEATABLE_READ
:
case
TransactionIsolationLevel
::
SERIALIZABLE
:
return
'SERIALIZABLE'
;
default
:
return
parent
::
_getTransactionIsolationLevelSQL
(
$level
);
...
...
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
View file @
45b57743
...
...
@@ -19,7 +19,6 @@
namespace
Doctrine\DBAL\Platforms
;
use
Doctrine\DBAL\Connection
;
use
Doctrine\DBAL\DBALException
;
use
Doctrine\DBAL\LockMode
;
use
Doctrine\DBAL\Schema\Column
;
...
...
@@ -30,6 +29,7 @@ use Doctrine\DBAL\Schema\Identifier;
use
Doctrine\DBAL\Schema\Index
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\TransactionIsolationLevel
;
/**
* The SQLAnywherePlatform provides the behavior, features and SQL dialect of the
...
...
@@ -533,7 +533,7 @@ class SQLAnywherePlatform extends AbstractPlatform
*/
public
function
getDefaultTransactionIsolationLevel
()
{
return
Connection
::
TRANSACTION_
READ_UNCOMMITTED
;
return
TransactionIsolationLevel
::
READ_UNCOMMITTED
;
}
/**
...
...
@@ -1275,13 +1275,13 @@ class SQLAnywherePlatform extends AbstractPlatform
protected
function
_getTransactionIsolationLevelSQL
(
$level
)
{
switch
(
$level
)
{
case
Connection
::
TRANSACTION_
READ_UNCOMMITTED
:
case
TransactionIsolationLevel
::
READ_UNCOMMITTED
:
return
0
;
case
Connection
::
TRANSACTION_
READ_COMMITTED
:
case
TransactionIsolationLevel
::
READ_COMMITTED
:
return
1
;
case
Connection
::
TRANSACTION_
REPEATABLE_READ
:
case
TransactionIsolationLevel
::
REPEATABLE_READ
:
return
2
;
case
Connection
::
TRANSACTION_
SERIALIZABLE
:
case
TransactionIsolationLevel
::
SERIALIZABLE
:
return
3
;
default
:
throw
new
\InvalidArgumentException
(
'Invalid isolation level:'
.
$level
);
...
...
lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
View file @
45b57743
...
...
@@ -27,6 +27,7 @@ use Doctrine\DBAL\Schema\Identifier;
use
Doctrine\DBAL\Schema\Index
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\TransactionIsolationLevel
;
use
Doctrine\DBAL\Types
;
/**
...
...
@@ -167,11 +168,11 @@ class SqlitePlatform extends AbstractPlatform
protected
function
_getTransactionIsolationLevelSQL
(
$level
)
{
switch
(
$level
)
{
case
\Doctrine\DBAL\Connection
::
TRANSACTION_
READ_UNCOMMITTED
:
case
TransactionIsolationLevel
::
READ_UNCOMMITTED
:
return
0
;
case
\Doctrine\DBAL\Connection
::
TRANSACTION_
READ_COMMITTED
:
case
\Doctrine\DBAL\Connection
::
TRANSACTION_
REPEATABLE_READ
:
case
\Doctrine\DBAL\Connection
::
TRANSACTION_
SERIALIZABLE
:
case
TransactionIsolationLevel
::
READ_COMMITTED
:
case
TransactionIsolationLevel
::
REPEATABLE_READ
:
case
TransactionIsolationLevel
::
SERIALIZABLE
:
return
1
;
default
:
return
parent
::
_getTransactionIsolationLevelSQL
(
$level
);
...
...
lib/Doctrine/DBAL/TransactionIsolationLevel.php
0 → 100644
View file @
45b57743
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\DBAL
;
final
class
TransactionIsolationLevel
{
/**
* Transaction isolation level READ UNCOMMITTED.
*/
public
const
READ_UNCOMMITTED
=
1
;
/**
* Transaction isolation level READ COMMITTED.
*/
public
const
READ_COMMITTED
=
2
;
/**
* Transaction isolation level REPEATABLE READ.
*/
public
const
REPEATABLE_READ
=
3
;
/**
* Transaction isolation level SERIALIZABLE.
*/
public
const
SERIALIZABLE
=
4
;
private
function
__construct
()
{
}
}
tests/Doctrine/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php
View file @
45b57743
...
...
@@ -8,6 +8,7 @@ use Doctrine\DBAL\Schema\ForeignKeyConstraint;
use
Doctrine\DBAL\Schema\Index
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\TransactionIsolationLevel
;
abstract
class
AbstractMySQLPlatformTestCase
extends
AbstractPlatformTestCase
{
...
...
@@ -56,20 +57,20 @@ abstract class AbstractMySQLPlatformTestCase extends AbstractPlatformTestCase
{
self
::
assertEquals
(
'SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_
READ_UNCOMMITTED
),
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
READ_UNCOMMITTED
),
''
);
self
::
assertEquals
(
'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_
READ_COMMITTED
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
READ_COMMITTED
)
);
self
::
assertEquals
(
'SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_
REPEATABLE_READ
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
REPEATABLE_READ
)
);
self
::
assertEquals
(
'SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_
SERIALIZABLE
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
SERIALIZABLE
)
);
}
...
...
tests/Doctrine/Tests/DBAL/Platforms/AbstractPostgreSqlPlatformTestCase.php
View file @
45b57743
...
...
@@ -6,6 +6,7 @@ use Doctrine\DBAL\Schema\Column;
use
Doctrine\DBAL\Schema\Comparator
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\TransactionIsolationLevel
;
use
Doctrine\DBAL\Types\Type
;
abstract
class
AbstractPostgreSqlPlatformTestCase
extends
AbstractPlatformTestCase
...
...
@@ -112,19 +113,19 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa
{
self
::
assertEquals
(
'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL READ UNCOMMITTED'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_
READ_UNCOMMITTED
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
READ_UNCOMMITTED
)
);
self
::
assertEquals
(
'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL READ COMMITTED'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_
READ_COMMITTED
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
READ_COMMITTED
)
);
self
::
assertEquals
(
'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL REPEATABLE READ'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_
REPEATABLE_READ
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
REPEATABLE_READ
)
);
self
::
assertEquals
(
'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_
SERIALIZABLE
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
SERIALIZABLE
)
);
}
...
...
tests/Doctrine/Tests/DBAL/Platforms/AbstractSQLServerPlatformTestCase.php
View file @
45b57743
...
...
@@ -6,6 +6,7 @@ use Doctrine\DBAL\Schema\Column;
use
Doctrine\DBAL\Schema\ColumnDiff
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\TransactionIsolationLevel
;
use
Doctrine\DBAL\Types\Type
;
abstract
class
AbstractSQLServerPlatformTestCase
extends
AbstractPlatformTestCase
...
...
@@ -65,20 +66,20 @@ abstract class AbstractSQLServerPlatformTestCase extends AbstractPlatformTestCas
public
function
testGeneratesTransactionsCommands
()
{
self
::
assertEquals
(
'SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_
READ_UNCOMMITTED
)
'SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
READ_UNCOMMITTED
)
);
self
::
assertEquals
(
'SET TRANSACTION ISOLATION LEVEL READ COMMITTED'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_
READ_COMMITTED
)
'SET TRANSACTION ISOLATION LEVEL READ COMMITTED'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
READ_COMMITTED
)
);
self
::
assertEquals
(
'SET TRANSACTION ISOLATION LEVEL REPEATABLE READ'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_
REPEATABLE_READ
)
'SET TRANSACTION ISOLATION LEVEL REPEATABLE READ'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
REPEATABLE_READ
)
);
self
::
assertEquals
(
'SET TRANSACTION ISOLATION LEVEL SERIALIZABLE'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_
SERIALIZABLE
)
'SET TRANSACTION ISOLATION LEVEL SERIALIZABLE'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
SERIALIZABLE
)
);
}
...
...
tests/Doctrine/Tests/DBAL/Platforms/MySqlPlatformTest.php
View file @
45b57743
...
...
@@ -3,7 +3,7 @@
namespace
Doctrine\Tests\DBAL\Platforms
;
use
Doctrine\DBAL\Platforms\MySqlPlatform
;
use
Doctrine\DBAL\
Connection
;
use
Doctrine\DBAL\
TransactionIsolationLevel
;
class
MySqlPlatformTest
extends
AbstractMySQLPlatformTestCase
{
...
...
@@ -15,7 +15,7 @@ class MySqlPlatformTest extends AbstractMySQLPlatformTestCase
public
function
testHasCorrectDefaultTransactionIsolationLevel
()
{
self
::
assertEquals
(
Connection
::
TRANSACTION_
REPEATABLE_READ
,
TransactionIsolationLevel
::
REPEATABLE_READ
,
$this
->
_platform
->
getDefaultTransactionIsolationLevel
()
);
}
...
...
tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php
View file @
45b57743
...
...
@@ -8,6 +8,7 @@ use Doctrine\DBAL\Schema\Column;
use
Doctrine\DBAL\Schema\Comparator
;
use
Doctrine\DBAL\Schema\ForeignKeyConstraint
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\TransactionIsolationLevel
;
use
Doctrine\DBAL\Types\Type
;
class
OraclePlatformTest
extends
AbstractPlatformTestCase
...
...
@@ -106,19 +107,19 @@ class OraclePlatformTest extends AbstractPlatformTestCase
{
self
::
assertEquals
(
'SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_
READ_UNCOMMITTED
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
READ_UNCOMMITTED
)
);
self
::
assertEquals
(
'SET TRANSACTION ISOLATION LEVEL READ COMMITTED'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_
READ_COMMITTED
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
READ_COMMITTED
)
);
self
::
assertEquals
(
'SET TRANSACTION ISOLATION LEVEL SERIALIZABLE'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_
REPEATABLE_READ
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
REPEATABLE_READ
)
);
self
::
assertEquals
(
'SET TRANSACTION ISOLATION LEVEL SERIALIZABLE'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_
SERIALIZABLE
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
SERIALIZABLE
)
);
}
...
...
tests/Doctrine/Tests/DBAL/Platforms/SQLAnywherePlatformTest.php
View file @
45b57743
...
...
@@ -13,6 +13,7 @@ use Doctrine\DBAL\Schema\ForeignKeyConstraint;
use
Doctrine\DBAL\Schema\Index
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\TransactionIsolationLevel
;
use
Doctrine\DBAL\Types\Type
;
class
SQLAnywherePlatformTest
extends
AbstractPlatformTestCase
...
...
@@ -601,7 +602,7 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
public
function
testHasCorrectDefaultTransactionIsolationLevel
()
{
self
::
assertEquals
(
Connection
::
TRANSACTION_
READ_UNCOMMITTED
,
TransactionIsolationLevel
::
READ_UNCOMMITTED
,
$this
->
_platform
->
getDefaultTransactionIsolationLevel
()
);
}
...
...
@@ -610,19 +611,19 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
{
self
::
assertEquals
(
'SET TEMPORARY OPTION isolation_level = 0'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
Connection
::
TRANSACTION_
READ_UNCOMMITTED
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
READ_UNCOMMITTED
)
);
self
::
assertEquals
(
'SET TEMPORARY OPTION isolation_level = 1'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
Connection
::
TRANSACTION_
READ_COMMITTED
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
READ_COMMITTED
)
);
self
::
assertEquals
(
'SET TEMPORARY OPTION isolation_level = 2'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
Connection
::
TRANSACTION_
REPEATABLE_READ
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
REPEATABLE_READ
)
);
self
::
assertEquals
(
'SET TEMPORARY OPTION isolation_level = 3'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
Connection
::
TRANSACTION_
SERIALIZABLE
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
SERIALIZABLE
)
);
}
...
...
tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php
View file @
45b57743
...
...
@@ -7,6 +7,7 @@ use Doctrine\DBAL\Platforms\SqlitePlatform;
use
Doctrine\DBAL\Schema\Column
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\TransactionIsolationLevel
;
use
Doctrine\DBAL\Types\Type
;
class
SqlitePlatformTest
extends
AbstractPlatformTestCase
...
...
@@ -40,19 +41,19 @@ class SqlitePlatformTest extends AbstractPlatformTestCase
{
self
::
assertEquals
(
'PRAGMA read_uncommitted = 0'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_
READ_UNCOMMITTED
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
READ_UNCOMMITTED
)
);
self
::
assertEquals
(
'PRAGMA read_uncommitted = 1'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_
READ_COMMITTED
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
READ_COMMITTED
)
);
self
::
assertEquals
(
'PRAGMA read_uncommitted = 1'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_
REPEATABLE_READ
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
REPEATABLE_READ
)
);
self
::
assertEquals
(
'PRAGMA read_uncommitted = 1'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_
SERIALIZABLE
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
TransactionIsolationLevel
::
SERIALIZABLE
)
);
}
...
...
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