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
6d9e5a5a
Commit
6d9e5a5a
authored
Jan 26, 2020
by
Benjamin Morel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up unused variables
parent
7f4ef4ac
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
22 additions
and
26 deletions
+22
-26
Connection.php
lib/Doctrine/DBAL/Connection.php
+0
-2
QueryCacheProfileTest.php
tests/Doctrine/Tests/DBAL/Cache/QueryCacheProfileTest.php
+1
-1
MysqliConnectionTest.php
...octrine/Tests/DBAL/Driver/Mysqli/MysqliConnectionTest.php
+2
-2
ResultCacheTest.php
tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php
+4
-4
PostgreSqlSchemaManagerTest.php
...ts/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php
+4
-4
AbstractPlatformTestCase.php
...octrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php
+1
-1
ComparatorTest.php
tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php
+2
-2
MySqlInheritCharsetTest.php
tests/Doctrine/Tests/DBAL/Schema/MySqlInheritCharsetTest.php
+1
-3
SchemaTest.php
tests/Doctrine/Tests/DBAL/Schema/SchemaTest.php
+2
-2
TableTest.php
tests/Doctrine/Tests/DBAL/Schema/TableTest.php
+3
-3
SerializationFailedTest.php
...ne/Tests/DBAL/Types/Exception/SerializationFailedTest.php
+2
-2
No files found.
lib/Doctrine/DBAL/Connection.php
View file @
6d9e5a5a
...
...
@@ -1093,8 +1093,6 @@ class Connection implements DriverConnection
throw
CommitFailedRollbackOnly
::
new
();
}
$result
=
true
;
$connection
=
$this
->
getWrappedConnection
();
$logger
=
$this
->
_config
->
getSQLLogger
();
...
...
tests/Doctrine/Tests/DBAL/Cache/QueryCacheProfileTest.php
View file @
6d9e5a5a
...
...
@@ -99,7 +99,7 @@ class QueryCacheProfileTest extends DbalTestCase
{
$this
->
queryCacheProfile
=
$this
->
queryCacheProfile
->
setCacheKey
(
null
);
[
$cacheKey
,
$queryString
]
=
$this
->
queryCacheProfile
->
generateCacheKeys
(
[,
$queryString
]
=
$this
->
queryCacheProfile
->
generateCacheKeys
(
$this
->
query
,
$this
->
params
,
$this
->
types
,
...
...
tests/Doctrine/Tests/DBAL/Driver/Mysqli/MysqliConnectionTest.php
View file @
6d9e5a5a
...
...
@@ -31,10 +31,10 @@ class MysqliConnectionTest extends DbalFunctionalTestCase
public
function
testRestoresErrorHandlerOnException
()
:
void
{
$handler
=
static
function
()
:
bool
{
$handler
=
static
function
()
:
bool
{
self
::
fail
(
'Never expected this to be called'
);
};
$default_handler
=
set_error_handler
(
$handler
);
set_error_handler
(
$handler
);
try
{
new
MysqliConnection
([
'host'
=>
'255.255.255.255'
],
'user'
,
'pass'
);
...
...
tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php
View file @
6d9e5a5a
...
...
@@ -213,10 +213,10 @@ class ResultCacheTest extends DbalFunctionalTestCase
public
function
testEmptyResultCache
()
:
void
{
$stmt
=
$this
->
connection
->
executeQuery
(
'SELECT * FROM caching WHERE test_int > 500'
,
[],
[],
new
QueryCacheProfile
(
10
,
'emptycachekey'
));
$
data
=
$
this
->
hydrateStmt
(
$stmt
);
$this
->
hydrateStmt
(
$stmt
);
$stmt
=
$this
->
connection
->
executeQuery
(
'SELECT * FROM caching WHERE test_int > 500'
,
[],
[],
new
QueryCacheProfile
(
10
,
'emptycachekey'
));
$
data
=
$
this
->
hydrateStmt
(
$stmt
);
$this
->
hydrateStmt
(
$stmt
);
self
::
assertCount
(
1
,
$this
->
sqlLogger
->
queries
,
'just one dbal hit'
);
}
...
...
@@ -224,11 +224,11 @@ class ResultCacheTest extends DbalFunctionalTestCase
public
function
testChangeCacheImpl
()
:
void
{
$stmt
=
$this
->
connection
->
executeQuery
(
'SELECT * FROM caching WHERE test_int > 500'
,
[],
[],
new
QueryCacheProfile
(
10
,
'emptycachekey'
));
$
data
=
$
this
->
hydrateStmt
(
$stmt
);
$this
->
hydrateStmt
(
$stmt
);
$secondCache
=
new
ArrayCache
();
$stmt
=
$this
->
connection
->
executeQuery
(
'SELECT * FROM caching WHERE test_int > 500'
,
[],
[],
new
QueryCacheProfile
(
10
,
'emptycachekey'
,
$secondCache
));
$
data
=
$
this
->
hydrateStmt
(
$stmt
);
$this
->
hydrateStmt
(
$stmt
);
self
::
assertCount
(
2
,
$this
->
sqlLogger
->
queries
,
'two hits'
);
self
::
assertCount
(
1
,
$secondCache
->
fetch
(
'emptycachekey'
));
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php
View file @
6d9e5a5a
...
...
@@ -98,7 +98,7 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
public
function
testAlterTableAutoIncrementAdd
()
:
void
{
$tableFrom
=
new
Table
(
'autoinc_table_add'
);
$
column
=
$
tableFrom
->
addColumn
(
'id'
,
'integer'
);
$tableFrom
->
addColumn
(
'id'
,
'integer'
);
$this
->
schemaManager
->
createTable
(
$tableFrom
);
$tableFrom
=
$this
->
schemaManager
->
listTableDetails
(
'autoinc_table_add'
);
self
::
assertFalse
(
$tableFrom
->
getColumn
(
'id'
)
->
getAutoincrement
());
...
...
@@ -137,7 +137,7 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
self
::
assertTrue
(
$tableFrom
->
getColumn
(
'id'
)
->
getAutoincrement
());
$tableTo
=
new
Table
(
'autoinc_table_drop'
);
$
column
=
$
tableTo
->
addColumn
(
'id'
,
'integer'
);
$tableTo
->
addColumn
(
'id'
,
'integer'
);
$c
=
new
Comparator
();
$diff
=
$c
->
diffTable
(
$tableFrom
,
$tableTo
);
...
...
@@ -219,10 +219,10 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
public
function
testFilterSchemaExpression
()
:
void
{
$testTable
=
new
Table
(
'dbal204_test_prefix'
);
$
column
=
$
testTable
->
addColumn
(
'id'
,
'integer'
);
$testTable
->
addColumn
(
'id'
,
'integer'
);
$this
->
schemaManager
->
createTable
(
$testTable
);
$testTable
=
new
Table
(
'dbal204_without_prefix'
);
$
column
=
$
testTable
->
addColumn
(
'id'
,
'integer'
);
$testTable
->
addColumn
(
'id'
,
'integer'
);
$this
->
schemaManager
->
createTable
(
$testTable
);
$this
->
connection
->
getConfiguration
()
->
setSchemaAssetsFilter
(
static
function
(
string
$name
)
:
bool
{
...
...
tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php
View file @
6d9e5a5a
...
...
@@ -165,7 +165,7 @@ abstract class AbstractPlatformTestCase extends DbalTestCase
$table
=
new
Table
(
'test'
);
$this
->
expectException
(
DBALException
::
class
);
$
sql
=
$
this
->
platform
->
getCreateTableSQL
(
$table
);
$this
->
platform
->
getCreateTableSQL
(
$table
);
}
public
function
testGeneratesTableCreationSql
()
:
void
...
...
tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php
View file @
6d9e5a5a
...
...
@@ -863,8 +863,8 @@ class ComparatorTest extends TestCase
*/
public
function
testChangedSequence
()
:
void
{
$schema
=
new
Schema
();
$s
equence
=
$s
chema
->
createSequence
(
'baz'
);
$schema
=
new
Schema
();
$schema
->
createSequence
(
'baz'
);
$schemaNew
=
clone
$schema
;
$schemaNew
->
getSequence
(
'baz'
)
->
setAllocationSize
(
20
);
...
...
tests/Doctrine/Tests/DBAL/Schema/MySqlInheritCharsetTest.php
View file @
6d9e5a5a
...
...
@@ -37,9 +37,7 @@ class MySqlInheritCharsetTest extends TestCase
public
function
testTableOptions
()
:
void
{
$eventManager
=
new
EventManager
();
$driverMock
=
$this
->
createMock
(
Driver
::
class
);
$platform
=
new
MySqlPlatform
();
$platform
=
new
MySqlPlatform
();
// default, no overrides
$table
=
new
Table
(
'foobar'
,
[
new
Column
(
'aa'
,
Type
::
getType
(
'integer'
))]);
...
...
tests/Doctrine/Tests/DBAL/Schema/SchemaTest.php
View file @
6d9e5a5a
...
...
@@ -63,7 +63,7 @@ class SchemaTest extends TestCase
$table
=
new
Table
(
$tableName
);
$tables
=
[
$table
,
$table
];
$schema
=
new
Schema
(
$tables
);
new
Schema
(
$tables
);
}
public
function
testRenameTable
()
:
void
...
...
@@ -172,7 +172,7 @@ class SchemaTest extends TestCase
$sequence
=
new
Sequence
(
'a_seq'
,
1
,
1
);
$schema
=
new
Schema
([],
[
$sequence
,
$sequence
]);
new
Schema
([],
[
$sequence
,
$sequence
]);
}
public
function
testConfigMaxIdentifierLength
()
:
void
...
...
tests/Doctrine/Tests/DBAL/Schema/TableTest.php
View file @
6d9e5a5a
...
...
@@ -111,7 +111,7 @@ class TableTest extends DbalTestCase
$columns
=
[];
$columns
[]
=
new
Column
(
'foo'
,
$type
);
$columns
[]
=
new
Column
(
'foo'
,
$type
);
$table
=
new
Table
(
'foo'
,
$columns
,
[],
[]);
new
Table
(
'foo'
,
$columns
,
[],
[]);
}
public
function
testCreateIndex
()
:
void
...
...
@@ -184,7 +184,7 @@ class TableTest extends DbalTestCase
new
Index
(
'the_primary'
,
[
'foo'
],
true
,
true
),
new
Index
(
'other_primary'
,
[
'bar'
],
true
,
true
),
];
$table
=
new
Table
(
'foo'
,
$columns
,
$indexes
,
[]);
new
Table
(
'foo'
,
$columns
,
$indexes
,
[]);
}
public
function
testAddTwoIndexesWithSameNameThrowsException
()
:
void
...
...
@@ -197,7 +197,7 @@ class TableTest extends DbalTestCase
new
Index
(
'an_idx'
,
[
'foo'
],
false
,
false
),
new
Index
(
'an_idx'
,
[
'bar'
],
false
,
false
),
];
$table
=
new
Table
(
'foo'
,
$columns
,
$indexes
,
[]);
new
Table
(
'foo'
,
$columns
,
$indexes
,
[]);
}
public
function
testConstraints
()
:
void
...
...
tests/Doctrine/Tests/DBAL/Types/Exception/SerializationFailedTest.php
View file @
6d9e5a5a
...
...
@@ -14,8 +14,8 @@ class SerializationFailedTest extends TestCase
{
public
function
testNew
()
:
void
{
$value
=
NAN
;
$encoded
=
json_encode
(
$value
);
$value
=
NAN
;
json_encode
(
$value
);
$exception
=
SerializationFailed
::
new
(
$value
,
'json'
,
json_last_error_msg
());
...
...
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